SplitFirstStatement returns the length of the prefix of the string up to and including the first semicolon that separates statements. If there is no semicolon, returns ok=false.
(sql string)
| 964 | // including the first semicolon that separates statements. If there is no |
| 965 | // semicolon, returns ok=false. |
| 966 | func SplitFirstStatement(sql string) (pos int, ok bool) { |
| 967 | s := makeScanner(sql) |
| 968 | var lval sqlSymType |
| 969 | for { |
| 970 | s.scan(&lval) |
| 971 | switch lval.id { |
| 972 | case 0, ERROR: |
| 973 | return 0, false |
| 974 | case ';': |
| 975 | return s.pos, true |
| 976 | } |
| 977 | } |
| 978 | } |
| 979 | |
| 980 | // Tokens decomposes the input into lexical tokens. |
| 981 | func Tokens(sql string) (tokens []TokenString, ok bool) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…