You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+28Lines changed: 28 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -68,6 +68,34 @@ func main() {
68
68
}
69
69
```
70
70
71
+
Parsing SQL mode `ANSI_QUOTES`:
72
+
73
+
Treat `"` as an identifier quote character (like the \` quote character) and not as a string quote character. You can still use \` to quote identifiers with this mode enabled. With `ANSI_QUOTES` enabled, you cannot use double quotation marks to quote literal strings because they are interpreted as identifiers.
74
+
75
+
```go
76
+
package main
77
+
78
+
import (
79
+
"github.com/SananGuliyev/sqlparser"
80
+
)
81
+
82
+
funcmain() {
83
+
sql:="SELECT * FROM table WHERE a = 'abc'"
84
+
sqlparser.SQLMode = sqlparser.SQLModeANSIQuotes
85
+
stmt, err:= sqlparser.Parse(sql)
86
+
if err != nil {
87
+
// Do something with the err
88
+
}
89
+
90
+
// Otherwise do something with stmt
91
+
switchstmt:= stmt.(type) {
92
+
case *sqlparser.Select:
93
+
_ = stmt
94
+
case *sqlparser.Insert:
95
+
}
96
+
}
97
+
```
98
+
71
99
See [parse_test.go](https://github.com/SananGuliyev/sqlparser/blob/master/parse_test.go) for more examples, or read the [godoc](https://godoc.org/github.com/SananGuliyev/sqlparser).
0 commit comments