Class SqlScriptSplitter

java.lang.Object
dev.frostlake.executor.SqlScriptSplitter

public final class SqlScriptSplitter extends Object
Splits a multi-statement SQL SCRIPT into its top-level statements for clients that execute and report per statement (the HTTP server's init script, the console's script runner).

The GRAMMAR does the splitting: each parsed flowChain (a statement, or a ->> chain that must stay together) is one piece, so a semicolon inside a string literal, a $$-quoted body or a BEGIN...END block never splits — the character-level splitters this replaces mis-grouped everything after SELECT '$$'; and cut a multi-line literal at a line-trailing ';'. When the script does not parse whole, falls back to a LEXER-token split at SEMI (literals are single tokens even then), so per-statement execution can still surface the offending statement's own error.