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 avb@php.net |
---|---|
package |
phing.tasks.ext.pdo |
version |
$Id: 2e4cf5659024930ba454c239c5e288e2fd7dab37 $ |
link | |
link |
http://www.postgresql.org/docs/current/interactive/sql-syntax-lexical.html#SQL-SYNTAX-DOLLAR-QUOTING |
__construct(\PDOSQLExecTask $parent, \Reader $reader)
checkDollarQuote() : string|boolean
string|boolean
Dollar-quoting "tag" if it is present, false otherwise
getc() : string|boolean
string|boolean
nextQuery() : string|null
string|null
ungetc()
NB: we don't need ungetc() at the start of the line, so this case is not handled.
STATE_NORMAL
STATE_SINGLE_QUOTED
STATE_DOUBLE_QUOTED
STATE_DOLLAR_QUOTED
STATE_COMMENT_LINEEND
STATE_COMMENT_MULTILINE
STATE_BACKSLASH
quotingTag : string
var |
---|
string
state : integer
var |
---|
integer
escape : boolean
var |
---|
boolean
line : string
var |
---|
string
inputIndex : integer
var |
---|
integer
Nesting depth of current multiline comment
Type(s)
integer