File tree 1 file changed +30
-1
lines changed
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
30
30
31
31
- https://www.postgresql.org/docs/9.5/features.html
32
32
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
+ ```
34
62
35
63
### 🚧🚧🚧 still under construction 🚧🚧🚧
36
64
37
65
# Progress
38
66
- 2020-02-16 ` github.com/auxten/postgresql-parser/pkg/sql/parser ` Unit tests works now!
67
+ - 2020-03-08 Add walker package.
39
68
40
69
# Todo
41
70
- Fix more unit tests
You can’t perform that action at this time.
0 commit comments