Grammar
class Grammar extends Grammar
Properties
| protected string | $tablePrefix | The grammar table prefix. |
from Grammar |
| protected array | $operators | The grammar specific operators. |
|
| protected array | $selectComponents | The components that make up a select clause. |
Methods
Wrap a value that has an alias.
Convert an array of column names into a delimited string.
Get the appropriate query parameter place-holder for a value.
Format the where clause statements into one string.
Compile a single having clause.
Compile a basic having clause.
Compile the random statement into SQL.
Compile a single union statement.
Compile an insert and get ID statement into SQL.
Prepare the bindings for an update statement.
Determine if the grammar supports savepoints.
Compile the SQL statement to define a savepoint.
Compile the SQL statement to execute a savepoint rollback.
Concatenate an array of segments, removing empties.
Remove the leading boolean from a statement.
Get the grammar specific operators.
Details
in
Grammar at line 22
array
wrapArray(array $values)
Wrap an array of values.
in
Grammar at line 33
string
wrapTable(Expression|string $table)
Wrap a table in keyword identifiers.
in
Grammar at line 49
string
wrap(Expression|string $value, bool $prefixAlias = false)
Wrap a value in keyword identifiers.
in
Grammar at line 72
protected string
wrapAliasedValue(string $value, bool $prefixAlias = false)
Wrap a value that has an alias.
in
Grammar at line 94
protected string
wrapSegments(array $segments)
Wrap the given value segments.
in
Grammar at line 109
protected string
wrapValue(string $value)
Wrap a single string in keyword identifiers.
in
Grammar at line 124
string
columnize(array $columns)
Convert an array of column names into a delimited string.
in
Grammar at line 135
string
parameterize(array $values)
Create query parameter place-holders for an array.
in
Grammar at line 146
string
parameter(mixed $value)
Get the appropriate query parameter place-holder for a value.
in
Grammar at line 157
bool
isExpression(mixed $value)
Determine if the given value is a raw expression.
in
Grammar at line 168
string
getValue(Expression $expression)
Get the value of a raw expression.
in
Grammar at line 178
string
getDateFormat()
Get the format for database stored dates.
in
Grammar at line 188
string
getTablePrefix()
Get the grammar's table prefix.
in
Grammar at line 199
$this
setTablePrefix(string $prefix)
Set the grammar's table prefix.
at line 45
string
compileSelect(Builder $query)
Compile a select query into SQL.
at line 74
protected array
compileComponents(Builder $query)
Compile the components necessary for a select clause.
at line 99
protected string
compileAggregate(Builder $query, array $aggregate)
Compile an aggregated select clause.
at line 120
protected string|null
compileColumns(Builder $query, array $columns)
Compile the "select *" portion of the query.
at line 141
protected string
compileFrom(Builder $query, string $table)
Compile the "from" portion of the query.
at line 153
protected string
compileJoins(Builder $query, array $joins)
Compile the "join" portions of the query.
at line 168
protected string
compileWheres(Builder $query)
Compile the "where" portions of the query.
at line 193
protected array
compileWheresToArray(Builder $query)
Get an array of all the where clauses for the query.
at line 207
protected string
concatenateWhereClauses(Builder $query, array $sql)
Format the where clause statements into one string.
at line 221
protected string
whereRaw(Builder $query, array $where)
Compile a raw where clause.
at line 233
protected string
whereBasic(Builder $query, array $where)
Compile a basic where clause.
at line 247
protected string
whereIn(Builder $query, array $where)
Compile a "where in" clause.
at line 263
protected string
whereNotIn(Builder $query, array $where)
Compile a "where not in" clause.
at line 279
protected string
whereInSub(Builder $query, array $where)
Compile a where in sub-select clause.
at line 291
protected string
whereNotInSub(Builder $query, array $where)
Compile a where not in sub-select clause.
at line 303
protected string
whereNull(Builder $query, array $where)
Compile a "where null" clause.
at line 315
protected string
whereNotNull(Builder $query, array $where)
Compile a "where not null" clause.
at line 327
protected string
whereBetween(Builder $query, array $where)
Compile a "between" where clause.
at line 341
protected string
whereDate(Builder $query, array $where)
Compile a "where date" clause.
at line 353
protected string
whereTime(Builder $query, array $where)
Compile a "where time" clause.
at line 365
protected string
whereDay(Builder $query, array $where)
Compile a "where day" clause.
at line 377
protected string
whereMonth(Builder $query, array $where)
Compile a "where month" clause.
at line 389
protected string
whereYear(Builder $query, array $where)
Compile a "where year" clause.
at line 402
protected string
dateBasedWhere(string $type, Builder $query, array $where)
Compile a date based where clause.
at line 416
protected string
whereColumn(Builder $query, array $where)
Compile a where clause comparing two columns.
.
at line 428
protected string
whereNested(Builder $query, array $where)
Compile a nested where clause.
at line 445
protected string
whereSub(Builder $query, array $where)
Compile a where condition with a sub-select.
at line 459
protected string
whereExists(Builder $query, array $where)
Compile a where exists clause.
at line 471
protected string
whereNotExists(Builder $query, array $where)
Compile a where exists clause.
at line 483
protected string
compileGroups(Builder $query, array $groups)
Compile the "group by" portions of the query.
at line 495
protected string
compileHavings(Builder $query, array $havings)
Compile the "having" portions of the query.
at line 508
protected string
compileHaving(array $having)
Compile a single having clause.
at line 526
protected string
compileBasicHaving(array $having)
Compile a basic having clause.
at line 542
protected string
compileOrders(Builder $query, array $orders)
Compile the "order by" portions of the query.
at line 558
protected array
compileOrdersToArray(Builder $query, array $orders)
Compile the query orders to an array.
at line 573
string
compileRandom(string $seed)
Compile the random statement into SQL.
at line 585
protected string
compileLimit(Builder $query, int $limit)
Compile the "limit" portions of the query.
at line 597
protected string
compileOffset(Builder $query, int $offset)
Compile the "offset" portions of the query.
at line 608
protected string
compileUnions(Builder $query)
Compile the "union" queries attached to the main query.
at line 637
protected string
compileUnion(array $union)
Compile a single union statement.
at line 650
string
compileExists(Builder $query)
Compile an exists statement into SQL.
at line 664
string
compileInsert(Builder $query, array $values)
Compile an insert statement into SQL.
at line 695
string
compileInsertGetId(Builder $query, array $values, string $sequence)
Compile an insert and get ID statement into SQL.
at line 707
string
compileUpdate(Builder $query, array $values)
Compile an update statement into SQL.
at line 742
array
prepareBindingsForUpdate(array $bindings, array $values)
Prepare the bindings for an update statement.
at line 757
string
compileDelete(Builder $query)
Compile a delete statement into SQL.
at line 770
array
compileTruncate(Builder $query)
Compile a truncate table statement into SQL.
at line 782
protected string
compileLock(Builder $query, bool|string $value)
Compile the lock into SQL.
at line 792
bool
supportsSavepoints()
Determine if the grammar supports savepoints.
at line 803
string
compileSavepoint(string $name)
Compile the SQL statement to define a savepoint.
at line 814
string
compileSavepointRollBack(string $name)
Compile the SQL statement to execute a savepoint rollback.
at line 825
protected string
concatenate(array $segments)
Concatenate an array of segments, removing empties.
at line 838
protected string
removeLeadingBoolean(string $value)
Remove the leading boolean from a statement.
at line 848
array
getOperators()
Get the grammar specific operators.