Constants

DIALECT_ANSI

DIALECT_ANSI

DIALECT_MYSQL

DIALECT_MYSQL

Properties

$token

$token : string

Type

string

$functions

$functions : array

Type

array

$types

$types : array

Type

array

$symbols

$symbols : array

Type

array

$operators

$operators : array

Type

array

$synonyms

$synonyms : array

Type

array

$lexeropts

$lexeropts : array

Type

array

$parseropts

$parseropts : array

Type

array

$comments

$comments : array

Type

array

$quotes

$quotes : array

Type

array

$dialects

$dialects : array

Type

array

$notes

$notes : 

Type

Methods

__construct()

__construct(string  $string = null, string  $dialect = 'ANSI') 

Constructor

Parameters

string $string

the SQL query to parse

string $dialect

the SQL dialect

initLexer()

initLexer(  $string) 

Parameters

$string

setDialect()

setDialect(string  $dialect) : mixed

loads SQL dialect specific data

Parameters

string $dialect

the SQL dialect to use

Returns

mixed —

true on success, otherwise Error

getParams()

getParams(  $values,   $types, integer  $i) : mixed

extracts parameters from a function call

this function should be called if an opening brace is found, so the first call to $this->getTok() will return first param or the closing )

Parameters

$values
$types
integer $i

position

Returns

mixed —

true on success, otherwise Error

raiseError()

raiseError(string  $message) : \Error

Parameters

string $message

error message

Returns

\Error

isType()

isType() : boolean

Returns true if current token is a variable type name, otherwise false

Returns

boolean —

true if current token is a variable type name

isVal()

isVal() : boolean

Returns true if current token is a value, otherwise false

Returns

boolean —

true if current token is a value

isFunc()

isFunc() : boolean

Returns true if current token is a function, otherwise false

Returns

boolean —

true if current token is a function

isCommand()

isCommand() : boolean

Returns true if current token is a command, otherwise false

Returns

boolean —

true if current token is a command

isReserved()

isReserved() : boolean

Returns true if current token is a reserved word, otherwise false

Returns

boolean —

true if current token is a reserved word

isOperator()

isOperator() : boolean

Returns true if current token is an operator, otherwise false

Returns

boolean —

true if current token is an operator

getTok()

getTok() : void

retrieves next token

parseFieldOptions()

parseFieldOptions() : array

Parses field/column options, usually for an CREATE or ALTER TABLE statement

Returns

array —

parsed field options

parseCondition()

parseCondition() : array

parses conditions usually used in WHERE or ON

Returns

array —

parsed condition

parseSelectExpression()

parseSelectExpression() 

parseFieldList()

parseFieldList() : mixed

Returns

mixed —

array parsed field list on success, otherwise Error

parseFunctionOpts()

parseFunctionOpts() : mixed

Parses parameters in a function call

Returns

mixed —

array parsed function options on success, otherwise Error

parseCreate()

parseCreate() : mixed

Returns

mixed —

array parsed create on success, otherwise Error

parseInsert()

parseInsert() : mixed

Returns

mixed —

array parsed insert on success, otherwise Error

parseUpdate()

parseUpdate() : mixed

UPDATE tablename SET (colname = (value|colname) (,|WHERE searchclause))+

Returns

mixed —

array parsed update on success, otherwise Error

parseTableFactor()

parseTableFactor() 

parseTableReference()

parseTableReference() 

parseFrom()

parseFrom() 

parseDelete()

parseDelete() : mixed

DELETE FROM tablename WHERE searchclause

Returns

mixed —

array parsed delete on success, otherwise Error

parseDrop()

parseDrop() : mixed

Returns

mixed —

array parsed drop on success, otherwise Error

parseIdentifier()

parseIdentifier(  $type = 'column') 

[[db.].table].column [[AS] alias]

  • @return array

Parameters

$type

parseSelect()

parseSelect(  $subSelect = false) : mixed

Parameters

$subSelect

Returns

mixed —

array parsed select on success, otherwise Error

parseLock()

parseLock() : array

tbl_name [[AS] alias] lock_type[, .

..]

Returns

array

parseLockType()

parseLockType() : array

READ [LOCAL] | [LOW_PRIORITY] WRITE

Returns

array

parseQuery()

parseQuery() : array

Returns

array —

parsed data

parse()

parse(  $string = null) 

Parameters

$string