Skip to content

Commit 41a590b

Browse files
committed
Edit README
1 parent 123c61a commit 41a590b

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,44 @@ Open source implementation of the SOQL parser for Go.
99

1010
---
1111

12+
## 🧭 Examples
13+
14+
* [Live demo](https://shellyln.github.io/soql/)
15+
16+
## 🚀 Getting started
17+
18+
```go
19+
package main
20+
21+
import (
22+
"bytes"
23+
"encoding/json"
24+
"fmt"
25+
"github.com/shellyln/go-open-soql-parser/soql/parser"
26+
)
27+
28+
func main() {
29+
src := `
30+
SELECT Id FROM Contact WHERE Name like 'a%'
31+
`
32+
33+
ret, err := parser.Parse(src)
34+
if err != nil {
35+
fmt.Println(err)
36+
}
37+
38+
jsonStr, err := json.Marshal(ret)
39+
if err != nil {
40+
println(err)
41+
}
42+
43+
var buf bytes.Buffer
44+
json.Indent(&buf, jsonStr, "", " ")
45+
46+
fmt.Println(buf.String())
47+
}
48+
```
49+
1250
## ⚖️ License
1351

1452
MIT

0 commit comments

Comments
 (0)