Skip to content

shellyln/go-open-soql-parser

Repository files navigation

go-open-soql-parser

Open source implementation of the SOQL parser for Go.

Test release Go version

logo


🧭 Examples

🚀 Getting started

package main

import (
    "bytes"
    "encoding/json"
    "fmt"
    "github.com/shellyln/go-open-soql-parser/soql/parser"
)

func main() {
    src := `
    SELECT Id FROM Contact WHERE Name like 'a%'
    `

    ret, err := parser.Parse(src)
    if err != nil {
        fmt.Println(err)
    }

    jsonStr, err := json.Marshal(ret)
    if err != nil {
        println(err)
    }

    var buf bytes.Buffer
    json.Indent(&b