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: 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 |
getc() : string|bool
string|bool
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
nextQuery() : string|null
string|null
__construct(\PDOSQLExecTask $parent, \Reader $reader)
STATE_NORMAL
STATE_SINGLE_QUOTED
STATE_DOUBLE_QUOTED
STATE_DOLLAR_QUOTED
STATE_COMMENT_LINEEND
STATE_COMMENT_MULTILINE
STATE_BACKSLASH
quotingTag : string
var |
---|
string
state : int
var |
---|
int
escape : bool
var |
---|
bool
line : string
var |
---|
string
inputIndex : int
var |
---|
int
Nesting depth of current multiline comment
Type(s)
int