Splits PostgreSQL's dialect of SQL into separate queries
Unlike DefaultPDOQuerySplitter this uses a lexer instead of regular expressions. This allows handling complex constructs like C-style comments (including nested ones) and dollar-quoted strings.
author | Alexey Borzov |
---|---|
package | phing.tasks.ext.pdo |
version | $Id: 0e3570c0e594f4396d833d77e841294855b297d9 $ |
link | http://www.phing.info/trac/ticket/499 |
link | http://www.postgresql.org/docs/current/interactive/sql-syntax-lexical.html#SQL-SYNTAX-DOLLAR-QUOTING |
__construct(\PDOSQLExecTask $parent, \Reader $reader)
getc() : string | bool
string
bool
nextQuery() : string | null
string
null
ungetc()
NB: we don't need ungetc() at the start of the line, so this case is not handled.
checkDollarQuote() : string | bool
string
bool
Dollar-quoting "tag" if it is present, false otherwise$escape : bool
$inputIndex : int
$line : string
$quotingTag : string
$state : int
STATE_BACKSLASH
STATE_COMMENT_LINEEND
STATE_COMMENT_MULTILINE
STATE_DOLLAR_QUOTED
STATE_DOUBLE_QUOTED
STATE_NORMAL
STATE_SINGLE_QUOTED