You are viewing an older version of the documentation. For the latest, please visit master documentation.

Grammar

Extends

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

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

whereFullText ( Builder $query , $where ) : string

Compile a "where fulltext" clause.

Parameters

protected

compileGroups ( Builder $query , $groups ) : string

Compile the "group by" portions of the query.

Parameters

protected

compileHavings ( Builder $query , $havings ) : 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

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

wrap ( $value , $prefixAlias ) : string

Wrap a value in keyword identifiers.

Parameters

protected

wrapJsonSelector ( $value ) : string

Wrap the given JSON selector.

Parameters

  • $value 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

wrapJsonFieldAndPath ( $column ) : array

Split the given JSON selector into the field and the optional path and wrap them separately.

Parameters

  • $column string
protected

wrapJsonPath ( $value , $delimiter ) : string

Wrap the given JSON path.

Parameters

  • $value string
  • $delimiter string
protected

isJsonSelector ( $value ) : bool

Determine if the given string is a JSON selector.

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

getOperators ( ) : array

Get the grammar specific operators.

public

getBitwiseOperators ( ) : array

Get the grammar specific bitwise operators.