File tree Expand file tree Collapse file tree 1 file changed +30
-1
lines changed Expand file tree Collapse file tree 1 file changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -30,12 +30,41 @@ The code is derived from CockroachDB v20.1.11 which supports most of the major f
3030
3131- https://www.postgresql.org/docs/9.5/features.html
3232
33-
33+ # How to use
34+
35+ ``` go
36+ package main
37+
38+ import (
39+ " log"
40+
41+ " github.com/auxten/postgresql-parser/pkg/walk"
42+ )
43+
44+ func main () {
45+ sql := ` select marr
46+ from (select marr_stat_cd AS marr, label AS l
47+ from root_loan_mock_v4
48+ order by root_loan_mock_v4.age desc, l desc
49+ limit 5) as v4
50+ LIMIT 1;`
51+ w := &walk.AstWalker {
52+ Fn: func (ctx interface {}, node interface {}) (stop bool ) {
53+ log.Printf (" node type %T " , node)
54+ return false
55+ },
56+ }
57+ _, _ = w.Walk (sql, nil )
58+ return
59+ }
60+
61+ ```
3462
3563### 🚧🚧🚧 still under construction 🚧🚧🚧
3664
3765# Progress
3866- 2020-02-16 ` github.com/auxten/postgresql-parser/pkg/sql/parser ` Unit tests works now!
67+ - 2020-03-08 Add walker package.
3968
4069# Todo
4170- Fix more unit tests
You can’t perform that action at this time.
0 commit comments