Added multi-query support

Updated example (q.sql)
This commit is contained in:
2022-01-11 15:16:17 -05:00
parent 6b2bd5011b
commit 90712aff7d
4 changed files with 113 additions and 54 deletions
+12 -5
View File
@@ -620,11 +620,18 @@ def parser(literal_string, ident, sqlserver=False):
+ Optional(assign("where", expr))
) / to_json_call
return (
inline_kblock
| udf
| query
sql_stmts = delimited_list( (
query
| (insert | update | delete)
| (create_table | create_view | create_cache | create_index)
| (drop_table | drop_view | drop_index)
).finalize()
)("stmts"), ";")
other_stmt = (
inline_kblock
| udf
) ("stmts")
stmts = ZeroOrMore(sql_stmts|other_stmt)
return stmts.finalize()