@@ -17,21 +17,6 @@ Due to compiling parts of PostgreSQL, the first time you build against this libr
17
17
18
18
Expect up to 3 minutes. You can use ` go build -x ` to see the progress.
19
19
20
- ## Usage with Go modules
21
-
22
- When integrating this library using Go modules, and using a vendor/ directory,
23
- you will need to explicitly copy over some of the C build files, since Go does
24
- not copy files in subfolders without .go files whilst vendoring.
25
-
26
- The best way to do so is to use [ modvendor] ( https://github.com/goware/modvendor ) ,
27
- and vendor your modules like this:
28
-
29
- ```
30
- go mod vendor
31
- go get -u github.com/goware/modvendor
32
- modvendor -copy="**/*.c **/*.h **/*.proto" -v
33
- ```
34
-
35
20
## Usage
36
21
37
22
### Parsing a query into JSON
@@ -59,7 +44,7 @@ func main() {
59
44
Running will output the query's parse tree as JSON:
60
45
61
46
``` json
62
- {"version" :160001 ,"stmts" :[{"stmt" :{"SelectStmt" :{"targetList" :[{"ResTarget" :{"val" :{"A_Const" :{"ival" :{"ival" :1 },"location" :7 }},"location" :7 }}],"limitOption" :" LIMIT_OPTION_DEFAULT" ,"op" :" SETOP_NONE" }}}]}
47
+ {"version" :170004 ,"stmts" :[{"stmt" :{"SelectStmt" :{"targetList" :[{"ResTarget" :{"val" :{"A_Const" :{"ival" :{"ival" :1 },"location" :7 }},"location" :7 }}],"limitOption" :" LIMIT_OPTION_DEFAULT" ,"op" :" SETOP_NONE" }}}]}
63
48
```
64
49
65
50
### Parsing a query into Go structs
@@ -210,6 +195,7 @@ See `benchmark_test.go` for details on the benchmarks.
210
195
## License
211
196
212
197
Copyright (c) 2015, Lukas Fittl
< [email protected] > <
br >
198
+ Copyright (c) 2016-2025, Duboce Labs, Inc. (pganalyze)
< [email protected] >
213
199
pg_query_go is licensed under the 3-clause BSD license, see LICENSE file for details.
214
200
215
201
This project includes code derived from the [ PostgreSQL project] ( http://www.postgresql.org/ ) ,
0 commit comments