class Firebird extends Compiler

Compiles Firebird queries.

Constants

JSON_PATH_SEPARATOR

JSON path separator.

Properties

static protected string $dateFormat Date format.
protected Query $query Query builder. from Compiler
protected array $params Query parameters. from Compiler

Methods

__construct(Query $query)

Constructor.

from Compiler
static string
setDateFormat(string $dateFormat)

Sets the date format.

from Compiler
static string
getDateFormat()

Gets the date format.

from Compiler
string
raw(Raw $raw)

Compiles a raw SQL statement.

from Compiler
string
subquery(Subquery $subquery, bool $enclose = true)

Compiles subquery, merges parameters and returns subquery SQL.

from Compiler
string
escapeIdentifier(string $identifier)

Returns an escaped identifier.

from Compiler
array
escapeIdentifiers(array $identifiers)

Returns an array of escaped identifiers.

from Compiler
bool
hasJsonPath(string $string)

Does the string have a JSON path?

from Compiler
string
buildJsonGet(string $column, array $segments)

Builds a JSON value getter.

from Compiler
string
buildJsonSet(string $column, array $segments, string $param)

Builds a JSON value setter.

from Compiler
string
escapeTable(string $table)

Escapes a table name.

from Compiler
string
setOperations(array $setOperations)

Compiles set operations.

from Compiler
string
table(mixed $table)

Compiles a table.

from Compiler
string
escapeColumn(string $column)

Escapes a column name.

from Compiler
string
compileColumnName(string $column)

Compiles a column name.

from Compiler
string
column(mixed $column, bool $allowAlias = false)

Compiles a column.

from Compiler
string
columns(array $columns, bool $allowAlias = false)

Returns a comma-separated list of compiled columns.

from Compiler
string
from(mixed $table)

Compiles the FROM clause.

from Compiler
string
param(mixed $param, bool $enclose = true)

Returns raw SQL or a paramter placeholder.

from Compiler
string
params(array $params, bool $enclose = true)

Returns a comma-separated list of parameters.

from Compiler
string
between(array $where)

Compiles BETWEEN clauses.

from Compiler
string
in(array $where)

Compiles IN clauses.

from Compiler
string
null(array $where)

Compiles IS NULL clauses.

from Compiler
string
exists(array $where)

Compiles EXISTS clauses.

from Compiler
string
where(array $where)

Compiles WHERE conditions.

from Compiler
string
whereRaw(array $where)

Compiles a raw WHERE condition.

from Compiler
string
nestedWhere(array $where)

Compiles nested WHERE conditions.

from Compiler
string
whereConditions(array $wheres)

Compiles WHERE conditions.

from Compiler
string
wheres(array $wheres)

Compiles WHERE clauses.

from Compiler
string
joinCondition(array $condition)

Compiles a JOIN condition.

from Compiler
string
nestedJoinCondition(array $condition)

Compiles nested JOIN condition.

from Compiler
string
joinConditions(Join $join)

Compiles JOIN conditions.

from Compiler
string
joins(array $joins)

Compiles JOIN clauses.

from Compiler
string
groupings(array $groupings)

Compiles GROUP BY clauses.

from Compiler
string
orderings(array $orderings)

Compiles ORDER BY clauses.

from Compiler
string
havingCondictions(array $havings)

Compiles HAVING conditions.

from Compiler
string
havings(array $havings)

Compiles HAVING clauses.

from Compiler
string
limit(int $limit = null)

Compiles LIMIT clauses.

string
offset(int $offset = null)

Compiles OFFSET clauses.

string
lock(bool|string|null $lock)

Compiles locking clause.

array
select()

Compiles a SELECT query.

from Compiler
string
insertWithValues(array $values)

Returns a INSERT query with values.

from Compiler
string
insertWithoutValues()

Returns a INSERT query without values.

from Compiler
array
insert(array $values = [])

Compiles a INSERT query.

from Compiler
string
updateColumns(array $columns)

Compiles update columns.

from Compiler
array
update(array $values)

Compiles a UPDATE query.

from Compiler
array
delete()

Compiles a DELETE query.

from Compiler

Details

in Compiler at line 70
__construct(Query $query)

Constructor.

Parameters

Query $query Query builder

in Compiler at line 81
static string setDateFormat(string $dateFormat)

Sets the date format.

Parameters

string $dateFormat Date format

Return Value

string

in Compiler at line 91
static string getDateFormat()

Gets the date format.

Return Value

string

in Compiler at line 102
protected string raw(Raw $raw)

Compiles a raw SQL statement.

Parameters

Raw $raw Raw SQL

Return Value

string

in Compiler at line 121
protected string subquery(Subquery $subquery, bool $enclose = true)

Compiles subquery, merges parameters and returns subquery SQL.

Parameters

Subquery $subquery Subquery container
bool $enclose Should the subquery be enclosed in parentheses?

Return Value

string

in Compiler at line 157
string escapeIdentifier(string $identifier)

Returns an escaped identifier.

Parameters

string $identifier Identifier to escape

Return Value

string

in Compiler at line 168
array escapeIdentifiers(array $identifiers)

Returns an array of escaped identifiers.

Parameters

array $identifiers Identifiers to escape

Return Value

array

in Compiler at line 184
protected bool hasJsonPath(string $string)

Does the string have a JSON path?

Parameters

string $string String

Return Value

bool

in Compiler at line 196
protected string buildJsonGet(string $column, array $segments)

Builds a JSON value getter.

Parameters

string $column Column name
array $segments JSON path segments

Return Value

string

in Compiler at line 209
protected string buildJsonSet(string $column, array $segments, string $param)

Builds a JSON value setter.

Parameters

string $column Column name
array $segments JSON path segments
string $param Parameter

Return Value

string

in Compiler at line 220
string escapeTable(string $table)

Escapes a table name.

Parameters

string $table Table name

Return Value

string

in Compiler at line 238
protected string setOperations(array $setOperations)

Compiles set operations.

Parameters

array $setOperations Set operations

Return Value

string

in Compiler at line 261
string table(mixed $table)

Compiles a table.

Parameters

mixed $table Table

Return Value

string

in Compiler at line 287
string escapeColumn(string $column)

Escapes a column name.

Parameters

string $column Column name

Return Value

string

in Compiler at line 312
protected string compileColumnName(string $column)

Compiles a column name.

Parameters

string $column Column name

Return Value

string

in Compiler at line 333
string column(mixed $column, bool $allowAlias = false)

Compiles a column.

Parameters

mixed $column Column
bool $allowAlias Allow aliases?

Return Value

string

in Compiler at line 360
string columns(array $columns, bool $allowAlias = false)

Returns a comma-separated list of compiled columns.

Parameters

array $columns Array of columns
bool $allowAlias Allow aliases?

Return Value

string

in Compiler at line 378
protected string from(mixed $table)

Compiles the FROM clause.

Parameters

mixed $table Table

Return Value

string

in Compiler at line 390
protected string param(mixed $param, bool $enclose = true)

Returns raw SQL or a paramter placeholder.

Parameters

mixed $param Parameter
bool $enclose Should subqueries be enclosed in parentheses?

Return Value

string

in Compiler at line 419
protected string params(array $params, bool $enclose = true)

Returns a comma-separated list of parameters.

Parameters

array $params Array of parameters
bool $enclose Should subqueries be enclosed in parentheses?

Return Value

string

in Compiler at line 437
protected string between(array $where)

Compiles BETWEEN clauses.

Parameters

array $where Where clause

Return Value

string

in Compiler at line 448
protected string in(array $where)

Compiles IN clauses.

Parameters

array $where Where clause

Return Value

string

in Compiler at line 461
protected string null(array $where)

Compiles IS NULL clauses.

Parameters

array $where Where clause

Return Value

string

in Compiler at line 472
protected string exists(array $where)

Compiles EXISTS clauses.

Parameters

array $where Exists clause

Return Value

string

in Compiler at line 483
protected string where(array $where)

Compiles WHERE conditions.

Parameters

array $where Where clause

Return Value

string

in Compiler at line 503
protected string whereRaw(array $where)

Compiles a raw WHERE condition.

Parameters

array $where Where clause

Return Value

string

in Compiler at line 514
protected string nestedWhere(array $where)

Compiles nested WHERE conditions.

Parameters

array $where Where clause

Return Value

string

in Compiler at line 525
protected string whereConditions(array $wheres)

Compiles WHERE conditions.

Parameters

array $wheres Where conditions

Return Value

string

in Compiler at line 547
protected string wheres(array $wheres)

Compiles WHERE clauses.

Parameters

array $wheres Array of where clauses

Return Value

string

in Compiler at line 563
protected string joinCondition(array $condition)

Compiles a JOIN condition.

Parameters

array $condition Join condition

Return Value

string

in Compiler at line 574
protected string nestedJoinCondition(array $condition)

Compiles nested JOIN condition.

Parameters

array $condition Join condition

Return Value

string

in Compiler at line 587
protected string joinConditions(Join $join)

Compiles JOIN conditions.

Parameters

Join $join Join

Return Value

string

in Compiler at line 609
protected string joins(array $joins)

Compiles JOIN clauses.

Parameters

array $joins Array of joins

Return Value

string

in Compiler at line 632
protected string groupings(array $groupings)

Compiles GROUP BY clauses.

Parameters

array $groupings Array of column names

Return Value

string

in Compiler at line 643
protected string orderings(array $orderings)

Compiles ORDER BY clauses.

Parameters

array $orderings Array of order by clauses

Return Value

string

in Compiler at line 666
protected string havingCondictions(array $havings)

Compiles HAVING conditions.

Parameters

array $havings Having conditions

Return Value

string

in Compiler at line 688
protected string havings(array $havings)

Compiles HAVING clauses.

Parameters

array $havings Array of having clauses

Return Value

string

at line 27
protected string limit(int $limit = null)

Compiles LIMIT clauses.

Parameters

int $limit Limit

Return Value

string

at line 37
protected string offset(int $offset = null)

Compiles OFFSET clauses.

Parameters

int $offset Limit

Return Value

string

at line 47
string lock(bool|string|null $lock)

Compiles locking clause.

Parameters

bool|string|null $lock

Return Value

string

in Compiler at line 736
array select()

Compiles a SELECT query.

Return Value

array

in Compiler at line 761
protected string insertWithValues(array $values)

Returns a INSERT query with values.

Parameters

array $values Array of values

Return Value

string

in Compiler at line 777
protected string insertWithoutValues()

Returns a INSERT query without values.

Return Value

string

in Compiler at line 788
array insert(array $values = [])

Compiles a INSERT query.

Parameters

array $values Array of values

Return Value

array

in Compiler at line 810
protected string updateColumns(array $columns)

Compiles update columns.

Parameters

array $columns Associative array of columns and values

Return Value

string

in Compiler at line 841
array update(array $values)

Compiles a UPDATE query.

Parameters

array $values Array of values

Return Value

array

in Compiler at line 858
array delete()

Compiles a DELETE query.

Return Value

array