Grammar

Extends

Uses

Properties

protected

$operators array

The grammar specific operators.

Default: []
protected

$bitwiseOperators array

The grammar specific bitwise operators.

Default: []
protected

$selectComponents string[]

The components that make up a select clause.

Default: array

Methods

public

compileSelect ( Builder $query ) : string

Compile a select query into SQL.

Parameters

protected

compileComponents ( Builder $query ) : array

Compile the components necessary for a select clause.

Parameters

protected

compileAggregate ( Builder $query , $aggregate ) : string

Compile an aggregated select clause.

Parameters

protected

compileColumns ( Builder $query , $columns ) : string|null

Compile the "select *" portion of the query.

Parameters

protected

compileFrom ( Builder $query , $table ) : string

Compile the "from" portion of the query.

Parameters

protected

compileJoins ( Builder $query , $joins ) : string

Compile the "join" portions of the query.

Parameters

public

compileWheres ( Builder $query ) : string

Compile the "where" portions of the query.

Parameters

protected

compileWheresToArray ( $query ) : array

Get an array of all the where clauses for the query.

Parameters

protected

concatenateWhereClauses ( $query , $sql ) : string

Format the where clause statements into one string.

Parameters

protected

whereRaw ( Builder $query , $where ) : string

Compile a raw where clause.

Parameters

protected

whereBasic ( Builder $query , $where ) : string

Compile a basic where clause.

Parameters

protected

whereBitwise ( Builder $query , $where ) : string

Compile a bitwise operator where clause.

Parameters

protected

whereIn ( Builder $query , $where ) : string

Compile a "where in" clause.

Parameters

protected

whereNotIn ( Builder $query , $where ) : string

Compile a "where not in" clause.

Parameters

protected

whereNotInRaw ( Builder $query , $where ) : string

Compile a "where not in raw" clause.

Parameters

protected

whereInRaw ( Builder $query , $where ) : string

Compile a "where in raw" clause.

Parameters

protected

whereNull ( Builder $query , $where ) : string

Compile a "where null" clause.

Parameters

protected

whereNotNull ( Builder $query , $where ) : string

Compile a "where not null" clause.

Parameters

protected

whereBetween ( Builder $query , $where ) : string

Compile a "between" where clause.

Parameters

protected

whereBetweenColumns ( Builder $query , $where ) : string

Compile a "between" where clause.

Parameters

protected

whereDate ( Builder $query , $where ) : string

Compile a "where date" clause.

Parameters

protected

whereTime ( Builder $query , $where ) : string

Compile a "where time" clause.

Parameters

protected

whereDay ( Builder $query , $where ) : string

Compile a "where day" clause.

Parameters

protected

whereMonth ( Builder $query , $where ) : string

Compile a "where month" clause.

Parameters

protected

whereYear ( Builder $query , $where ) : string

Compile a "where year" clause.

Parameters

protected

dateBasedWhere ( $type , Builder $query , $where ) : string

Compile a date based where clause.

Parameters

  • $type string
  • $query Builder
  • $where array
protected

whereColumn ( Builder $query , $where ) : string

Compile a where clause comparing two columns.

Parameters

protected

whereNested ( Builder $query , $where ) : string

Compile a nested where clause.

Parameters

protected

whereSub ( Builder $query , $where ) : string

Compile a where condition with a sub-select.

Parameters

protected

whereExists ( Builder $query , $where ) : string

Compile a where exists clause.

Parameters

protected

whereNotExists ( Builder $query , $where ) : string

Compile a where exists clause.

Parameters

protected

whereRowValues ( Builder $query , $where ) : string

Compile a where row values condition.

Parameters

protected

whereJsonBoolean ( Builder $query , $where ) : string

Compile a "where JSON boolean" clause.

Parameters

protected

whereJsonContains ( Builder $query , $where ) : string

Compile a "where JSON contains" clause.

Parameters

protected

compileJsonContains ( $column , $value ) : string

Compile a "JSON contains" statement into SQL.

Parameters

  • $column string
  • $value string
public

prepareBindingForJsonContains ( $binding ) : string

Prepare the binding for a "JSON contains" statement.

Parameters

  • $binding mixed
protected

whereJsonContainsKey ( Builder $query , $where ) : string

Compile a "where JSON contains key" clause.

Parameters

protected

compileJsonContainsKey ( $column ) : string

Compile a "JSON contains key" statement into SQL.

Parameters

  • $column string
protected

whereJsonLength ( Builder $query , $where ) : string

Compile a "where JSON length" clause.

Parameters

protected

compileJsonLength ( $column , $operator , $value ) : string

Compile a "JSON length" statement into SQL.

Parameters

  • $column string
  • $operator string
  • $value string
public

compileJsonValueCast ( $value ) : string

Compile a "JSON value cast" statement into SQL.

Parameters

  • $value string
public

whereFullText ( Builder $query , $where ) : string

Compile a "where fulltext" clause.

Parameters

public

whereExpression ( Builder $query , $where ) : string

Compile a clause based on an expression.

Parameters

protected

compileGroups ( Builder $query , $groups ) : string

Compile the "group by" portions of the query.

Parameters

protected

compileHavings ( Builder $query ) : string

Compile the "having" portions of the query.

Parameters

protected

compileHaving ( array $having ) : string

Compile a single having clause.

Parameters

  • $having array
protected

compileBasicHaving ( $having ) : string

Compile a basic having clause.

Parameters

  • $having array
protected

compileHavingBetween ( $having ) : string

Compile a "between" having clause.

Parameters

  • $having array
protected

compileHavingNull ( $having ) : string

Compile a having null clause.

Parameters

  • $having array
protected

compileHavingNotNull ( $having ) : string

Compile a having not null clause.

Parameters

  • $having array
protected

compileHavingBit ( $having ) : string

Compile a having clause involving a bit operator.

Parameters

  • $having array
protected

compileHavingExpression ( $having ) : string

Compile a having clause involving an expression.

Parameters

  • $having array
protected

compileNestedHavings ( $having ) : string

Compile a nested having clause.

Parameters

  • $having array
protected

compileOrders ( Builder $query , $orders ) : string

Compile the "order by" portions of the query.

Parameters

protected

compileOrdersToArray ( Builder $query , $orders ) : array

Compile the query orders to an array.

Parameters

public

compileRandom ( $seed ) : string

Compile the random statement into SQL.

Parameters

  • $seed string|int
protected

compileLimit ( Builder $query , $limit ) : string

Compile the "limit" portions of the query.

Parameters

protected

compileOffset ( Builder $query , $offset ) : string

Compile the "offset" portions of the query.

Parameters

protected

compileUnions ( Builder $query ) : string

Compile the "union" queries attached to the main query.

Parameters

protected

compileUnion ( array $union ) : string

Compile a single union statement.

Parameters

  • $union array
protected

wrapUnion ( $sql ) : string

Wrap a union subquery in parentheses.

Parameters

  • $sql string
protected

compileUnionAggregate ( Builder $query ) : string

Compile a union aggregate query into SQL.

Parameters

public

compileExists ( Builder $query ) : string

Compile an exists statement into SQL.

Parameters

public

compileInsert ( Builder $query , array $values ) : string

Compile an insert statement into SQL.

Parameters

public

compileInsertOrIgnore ( Builder $query , array $values ) : string

Compile an insert ignore statement into SQL.

Parameters

public

compileInsertGetId ( Builder $query , $values , $sequence ) : string

Compile an insert and get ID statement into SQL.

Parameters

  • $query Builder
  • $values array
  • $sequence string
public

compileInsertUsing ( Builder $query , array $columns , string $sql ) : string

Compile an insert statement using a subquery into SQL.

Parameters

  • $query Builder
  • $columns array
  • $sql string
public

compileUpdate ( Builder $query , array $values ) : string

Compile an update statement into SQL.

Parameters

protected

compileUpdateColumns ( Builder $query , array $values ) : string

Compile the columns for an update statement.

Parameters

protected

compileUpdateWithoutJoins ( Builder $query , $table , $columns , $where ) : string

Compile an update statement without joins into SQL.

Parameters

  • $query Builder
  • $table string
  • $columns string
  • $where string
protected

compileUpdateWithJoins ( Builder $query , $table , $columns , $where ) : string

Compile an update statement with joins into SQL.

Parameters

  • $query Builder
  • $table string
  • $columns string
  • $where string
public

compileUpsert ( Builder $query , array $values , array $uniqueBy , array $update ) : string

Compile an "upsert" statement into SQL.

Parameters

  • $query Builder
  • $values array
  • $uniqueBy array
  • $update array
public

prepareBindingsForUpdate ( array $bindings , array $values ) : array

Prepare the bindings for an update statement.

Parameters

  • $bindings array
  • $values array
public

compileDelete ( Builder $query ) : string

Compile a delete statement into SQL.

Parameters

protected

compileDeleteWithoutJoins ( Builder $query , $table , $where ) : string

Compile a delete statement without joins into SQL.

Parameters

  • $query Builder
  • $table string
  • $where string
protected

compileDeleteWithJoins ( Builder $query , $table , $where ) : string

Compile a delete statement with joins into SQL.

Parameters

  • $query Builder
  • $table string
  • $where string
public

prepareBindingsForDelete ( array $bindings ) : array

Prepare the bindings for a delete statement.

Parameters

  • $bindings array
public

compileTruncate ( Builder $query ) : array

Compile a truncate table statement into SQL.

Parameters

protected

compileLock ( Builder $query , $value ) : string

Compile the lock into SQL.

Parameters

public

supportsSavepoints ( ) : bool

Determine if the grammar supports savepoints.

public

compileSavepoint ( $name ) : string

Compile the SQL statement to define a savepoint.

Parameters

  • $name string
public

compileSavepointRollBack ( $name ) : string

Compile the SQL statement to execute a savepoint rollback.

Parameters

  • $name string
protected

wrapJsonBooleanSelector ( $value ) : string

Wrap the given JSON selector for boolean values.

Parameters

  • $value string
protected

wrapJsonBooleanValue ( $value ) : string

Wrap the given JSON boolean value.

Parameters

  • $value string
protected

concatenate ( $segments ) : string

Concatenate an array of segments, removing empties.

Parameters

  • $segments array
protected

removeLeadingBoolean ( $value ) : string

Remove the leading boolean from a statement.

Parameters

  • $value string
public

substituteBindingsIntoRawSql ( $sql , $bindings ) : string

Substitute the given bindings into the given raw SQL query.

Parameters

  • $sql string
  • $bindings array
public

getOperators ( ) : array

Get the grammar specific operators.

public

getBitwiseOperators ( ) : array

Get the grammar specific bitwise operators.