class Oracle extends Compiler

Compiles Oracle queries.

Traits

JSON path builder trait.

Constants

JSON_PATH_SEPARATOR

JSON path separator.

Properties

static protected $dateFormat {@inheritdoc}
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
subselect(Query $query)

Compiles a subselect and merges the parameters.

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

Compiles a subquery.

from Compiler
string
escapeIdentifier(string $identifier)

Returns an escaped identifier.

from Compiler
string
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.

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

Builds a JSON value setter.

from Compiler
string
escapeTableName(string $table)

Escapes a table name.

from Compiler
string
table(string|Raw|Subquery $table)

Compiles a table.

from Compiler
string
tables(array $tables)

Returns a comma-separated list of tables.

from Compiler
string
escapeColumnName(string $column)

Escapes a column name.

from Compiler
string
columnName(string $column)

Compiles a column name.

from Compiler
string
columnNames(array $columns)

Returns a comma-separated list of column names.

from Compiler
string
column(string|Raw|Subquery $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
commonTableExpressions(array $commonTableExpressions)

Compiles common table expressions.

from Compiler
string
setOperations(array $setOperations)

Compiles set operations.

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
simpleParam(mixed $param)

Returns a parameter placeholder.

from Compiler
string
simpleParams(array $params)

Returns a comma-separated list of parameter placeholders.

from Compiler
string
from(string|array|Subquery|Raw|null $table)

Compiles the FROM clause.

string
where(array $where)

Compiles WHERE conditions.

from Compiler
string
whereRaw(array $where)

Compiles a raw WHERE condition.

from Compiler
string
whereDate(array $where)

Compiles date comparison clauses.

string
whereColumn(array $where)

Compiles column comparison clauses.

from Compiler
string
between(array $where)

Compiles BETWEEN clauses.

from Compiler
string
betweenDate(array $where)

Compiles date range clauses.

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
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.

string
havingCondictions(array $havings)

Compiles HAVING conditions.

from Compiler
string
havings(array $havings)

Compiles HAVING clauses.

from Compiler
string
limit(int|null $limit)

Compiles LIMIT clauses.

string
offset(int|null $offset)

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
string
buildJsonPath(array $segments)

Builds a JSON path.

Details

in Compiler at line 69
__construct(Query $query)

Constructor.

Parameters

Query $query Query builder

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

Sets the date format.

Parameters

string $dateFormat Date format

Return Value

string

in Compiler at line 90
static string getDateFormat()

Gets the date format.

Return Value

string

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

Compiles a raw SQL statement.

Parameters

Raw $raw Raw SQL

Return Value

string

in Compiler at line 119
protected string subselect(Query $query)

Compiles a subselect and merges the parameters.

Parameters

Query $query Query

Return Value

string

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

Compiles a subquery.

Parameters

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

Return Value

string

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

Returns an escaped identifier.

Parameters

string $identifier Identifier to escape

Return Value

string

in Compiler at line 180
string escapeIdentifiers(array $identifiers)

Returns an array of escaped identifiers.

Parameters

array $identifiers Identifiers to escape

Return Value

string

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

Does the string have a JSON path?

Parameters

string $string String

Return Value

bool

at line 29
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 221
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 232
string escapeTableName(string $table)

Escapes a table name.

Parameters

string $table Table name

Return Value

string

in Compiler at line 250
string table(string|Raw|Subquery $table)

Compiles a table.

Parameters

string|Raw|Subquery $table Table

Return Value

string

in Compiler at line 276
string tables(array $tables)

Returns a comma-separated list of tables.

Parameters

array $tables Array of tables

Return Value

string

in Compiler at line 294
string escapeColumnName(string $column)

Escapes a column name.

Parameters

string $column Column name

Return Value

string

in Compiler at line 319
string columnName(string $column)

Compiles a column name.

Parameters

string $column Column name

Return Value

string

in Compiler at line 339
string columnNames(array $columns)

Returns a comma-separated list of column names.

Parameters

array $columns Array of column names

Return Value

string

in Compiler at line 358
string column(string|Raw|Subquery $column, bool $allowAlias = false)

Compiles a column.

Parameters

string|Raw|Subquery $column Column
bool $allowAlias Allow aliases?

Return Value

string

in Compiler at line 385
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 403
protected string commonTableExpressions(array $commonTableExpressions)

Compiles common table expressions.

Parameters

array $commonTableExpressions Common table expressions

Return Value

string

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

Compiles set operations.

Parameters

array $setOperations Set operations

Return Value

string

in Compiler at line 459
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 488
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 506
protected string simpleParam(mixed $param)

Returns a parameter placeholder.

Parameters

mixed $param Parameter

Return Value

string

in Compiler at line 519
protected string simpleParams(array $params)

Returns a comma-separated list of parameter placeholders.

Parameters

array $params Parameters

Return Value

string

at line 37
protected string from(string|array|Subquery|Raw|null $table)

Compiles the FROM clause.

Parameters

string|array|Subquery|Raw|null $table Table

Return Value

string

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

Compiles WHERE conditions.

Parameters

array $where Where clause

Return Value

string

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

Compiles a raw WHERE condition.

Parameters

array $where Where clause

Return Value

string

at line 53
protected string whereDate(array $where)

Compiles date comparison clauses.

Parameters

array $where Where clause

Return Value

string

in Compiler at line 595
protected string whereColumn(array $where)

Compiles column comparison clauses.

Parameters

array $where Where clause

Return Value

string

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

Compiles BETWEEN clauses.

Parameters

array $where Where clause

Return Value

string

at line 45
protected string betweenDate(array $where)

Compiles date range clauses.

Parameters

array $where Where clause

Return Value

string

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

Compiles IN clauses.

Parameters

array $where Where clause

Return Value

string

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

Compiles IS NULL clauses.

Parameters

array $where Where clause

Return Value

string

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

Compiles EXISTS clauses.

Parameters

array $where Exists clause

Return Value

string

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

Compiles nested WHERE conditions.

Parameters

array $where Where clause

Return Value

string

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

Compiles WHERE conditions.

Parameters

array $wheres Where conditions

Return Value

string

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

Compiles WHERE clauses.

Parameters

array $wheres Array of where clauses

Return Value

string

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

Compiles a JOIN condition.

Parameters

array $condition Join condition

Return Value

string

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

Compiles nested JOIN condition.

Parameters

array $condition Join condition

Return Value

string

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

Compiles JOIN conditions.

Parameters

Join $join Join

Return Value

string

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

Compiles JOIN clauses.

Parameters

array $joins Array of joins

Return Value

string

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

Compiles GROUP BY clauses.

Parameters

array $groupings Array of column names

Return Value

string

at line 74
protected string orderings(array $orderings)

Compiles ORDER BY clauses.

Parameters

array $orderings Array of order by clauses

Return Value

string

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

Compiles HAVING conditions.

Parameters

array $havings Having conditions

Return Value

string

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

Compiles HAVING clauses.

Parameters

array $havings Array of having clauses

Return Value

string

at line 87
protected string limit(int|null $limit)

Compiles LIMIT clauses.

Parameters

int|null $limit Limit

Return Value

string

at line 107
protected string offset(int|null $offset)

Compiles OFFSET clauses.

Parameters

int|null $offset Limit

Return Value

string

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

Compiles locking clause.

Parameters

bool|string|null $lock Lock

Return Value

string

in Compiler at line 894
array select()

Compiles a SELECT query.

Return Value

array

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

Returns a INSERT query with values.

Parameters

array $values Array of values

Return Value

string

in Compiler at line 935
protected string insertWithoutValues()

Returns a INSERT query without values.

Return Value

string

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

Compiles a INSERT query.

Parameters

array $values Array of values

Return Value

array

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

Compiles update columns.

Parameters

array $columns Associative array of columns and values

Return Value

string

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

Compiles a UPDATE query.

Parameters

array $values Array of values

Return Value

array

in Compiler at line 1016
array delete()

Compiles a DELETE query.

Return Value

array

in JsonPathBuilderTrait at line 26
protected string buildJsonPath(array $segments)

Builds a JSON path.

Parameters

array $segments Path segments

Return Value

string