MySqlGrammar
class MySqlGrammar extends Grammar (View source)
Properties
| protected string | $tablePrefix | The grammar table prefix. | from Grammar | 
| protected array | $operators | The grammar specific operators. | from Grammar | 
| protected array | $selectComponents | The components that make up a select clause. | 
Methods
| array |  wrapArray(array $values)  Wrap an array of values.  |  from Grammar | 
| string |  wrapTable(Expression|string $table)  Wrap a table in keyword identifiers.  |  from Grammar | 
| string |  wrap(Expression|string $value, bool $prefixAlias = false)  Wrap a value in keyword identifiers.  |  from Grammar | 
| string |  wrapAliasedValue(string $value, bool $prefixAlias = false)  Wrap a value that has an alias.  |  from Grammar | 
| string |  wrapSegments(array $segments)  Wrap the given value segments.  |  from Grammar | 
| string |  wrapValue(string $value)  Wrap a single string in keyword identifiers.  |  |
| string |  columnize(array $columns)  Convert an array of column names into a delimited string.  |  from Grammar | 
| string |  parameterize(array $values)  Create query parameter place-holders for an array.  |  from Grammar | 
| string |  parameter(mixed $value)  Get the appropriate query parameter place-holder for a value.  |  from Grammar | 
| bool |  isExpression(mixed $value)  Determine if the given value is a raw expression.  |  from Grammar | 
| string |  getValue(Expression $expression)  Get the value of a raw expression.  |  from Grammar | 
| string |  getDateFormat()  Get the format for database stored dates.  |  from Grammar | 
| string |  getTablePrefix()  Get the grammar's table prefix.  |  from Grammar | 
| $this |  setTablePrefix(string $prefix)  Set the grammar's table prefix.  |  from Grammar | 
| string |  compileSelect(Builder $query)  Compile a select query into SQL.  |  |
| array |  compileComponents(Builder $query)  Compile the components necessary for a select clause.  |  from Grammar | 
| string |  compileAggregate(Builder $query, array $aggregate)  Compile an aggregated select clause.  |  from Grammar | 
| string|null |  compileColumns(Builder $query, array $columns)  Compile the "select *" portion of the query.  |  from Grammar | 
| string |  compileFrom(Builder $query, string $table)  Compile the "from" portion of the query.  |  from Grammar | 
| string |  compileJoins(Builder $query, array $joins)  Compile the "join" portions of the query.  |  from Grammar | 
| string |  compileWheres(Builder $query)  Compile the "where" portions of the query.  |  from Grammar | 
| array |  compileWheresToArray(Builder $query)  Get an array of all the where clauses for the query.  |  from Grammar | 
| string |  concatenateWhereClauses(Builder $query, array $sql)  Format the where clause statements into one string.  |  from Grammar | 
| string |  whereRaw(Builder $query, array $where)  Compile a raw where clause.  |  from Grammar | 
| string |  whereBasic(Builder $query, array $where)  Compile a basic where clause.  |  from Grammar | 
| string |  whereIn(Builder $query, array $where)  Compile a "where in" clause.  |  from Grammar | 
| string |  whereNotIn(Builder $query, array $where)  Compile a "where not in" clause.  |  from Grammar | 
| string |  whereInSub(Builder $query, array $where)  Compile a where in sub-select clause.  |  from Grammar | 
| string |  whereNotInSub(Builder $query, array $where)  Compile a where not in sub-select clause.  |  from Grammar | 
| string |  whereNull(Builder $query, array $where)  Compile a "where null" clause.  |  from Grammar | 
| string |  whereNotNull(Builder $query, array $where)  Compile a "where not null" clause.  |  from Grammar | 
| string |  whereBetween(Builder $query, array $where)  Compile a "between" where clause.  |  from Grammar | 
| string |  whereDate(Builder $query, array $where)  Compile a "where date" clause.  |  from Grammar | 
| string |  whereTime(Builder $query, array $where)  Compile a "where time" clause.  |  from Grammar | 
| string |  whereDay(Builder $query, array $where)  Compile a "where day" clause.  |  from Grammar | 
| string |  whereMonth(Builder $query, array $where)  Compile a "where month" clause.  |  from Grammar | 
| string |  whereYear(Builder $query, array $where)  Compile a "where year" clause.  |  from Grammar | 
| string |  dateBasedWhere(string $type, Builder $query, array $where)  Compile a date based where clause.  |  from Grammar | 
| string |  whereColumn(Builder $query, array $where)  Compile a where clause comparing two columns.  |  from Grammar | 
| string |  whereNested(Builder $query, array $where)  Compile a nested where clause.  |  from Grammar | 
| string |  whereSub(Builder $query, array $where)  Compile a where condition with a sub-select.  |  from Grammar | 
| string |  whereExists(Builder $query, array $where)  Compile a where exists clause.  |  from Grammar | 
| string |  whereNotExists(Builder $query, array $where)  Compile a where exists clause.  |  from Grammar | 
| string |  compileGroups(Builder $query, array $groups)  Compile the "group by" portions of the query.  |  from Grammar | 
| string |  compileHavings(Builder $query, array $havings)  Compile the "having" portions of the query.  |  from Grammar | 
| string |  compileHaving(array $having)  Compile a single having clause.  |  from Grammar | 
| string |  compileBasicHaving(array $having)  Compile a basic having clause.  |  from Grammar | 
| string |  compileOrders(Builder $query, array $orders)  Compile the "order by" portions of the query.  |  from Grammar | 
| array |  compileOrdersToArray(Builder $query, array $orders)  Compile the query orders to an array.  |  from Grammar | 
| string |  compileRandom(string $seed)  Compile the random statement into SQL.  |  |
| string |  compileLimit(Builder $query, int $limit)  Compile the "limit" portions of the query.  |  from Grammar | 
| string |  compileOffset(Builder $query, int $offset)  Compile the "offset" portions of the query.  |  from Grammar | 
| string |  compileUnions(Builder $query)  Compile the "union" queries attached to the main query.  |  from Grammar | 
| string |  compileUnion(array $union)  Compile a single union statement.  |  |
| string |  compileExists(Builder $query)  Compile an exists statement into SQL.  |  from Grammar | 
| string |  compileInsert(Builder $query, array $values)  Compile an insert statement into SQL.  |  from Grammar | 
| string |  compileInsertGetId(Builder $query, array $values, string $sequence)  Compile an insert and get ID statement into SQL.  |  from Grammar | 
| string |  compileUpdate(Builder $query, array $values)  Compile an update statement into SQL.  |  |
| array |  prepareBindingsForUpdate(array $bindings, array $values)  Prepare the bindings for an update statement.  |  |
| string |  compileDelete(Builder $query)  Compile a delete statement into SQL.  |  |
| array |  compileTruncate(Builder $query)  Compile a truncate table statement into SQL.  |  from Grammar | 
| string |  compileLock(Builder $query, bool|string $value)  Compile the lock into SQL.  |  |
| bool |  supportsSavepoints()  Determine if the grammar supports savepoints.  |  from Grammar | 
| string |  compileSavepoint(string $name)  Compile the SQL statement to define a savepoint.  |  from Grammar | 
| string |  compileSavepointRollBack(string $name)  Compile the SQL statement to execute a savepoint rollback.  |  from Grammar | 
| string |  concatenate(array $segments)  Concatenate an array of segments, removing empties.  |  from Grammar | 
| string |  removeLeadingBoolean(string $value)  Remove the leading boolean from a statement.  |  from Grammar | 
| array |  getOperators()  Get the grammar specific operators.  |  from Grammar | 
| string |  compileUpdateColumns(array $values)  Compile all of the columns for an update statement.  |  |
| string |  compileJsonUpdateColumn(string $key, JsonExpression $value)  Prepares a JSON column being updated using the JSON_SET function.  |  |
| string |  compileDeleteWithoutJoins(Builder $query, string $table, array $where)  Compile a delete query that does not use joins.  |  |
| string |  compileDeleteWithJoins(Builder $query, string $table, array $where)  Compile a delete query that uses joins.  |  |
| string |  wrapJsonSelector(string $value)  Wrap the given JSON selector.  |  |
| bool |  isJsonSelector(string $value)  Determine if the given string is a JSON selector.  |  
Details
array wrapArray(array $values)
Wrap an array of values.
string wrapTable(Expression|string $table)
Wrap a table in keyword identifiers.
string wrap(Expression|string $value, bool $prefixAlias = false)
Wrap a value in keyword identifiers.
protected string wrapAliasedValue(string $value, bool $prefixAlias = false)
Wrap a value that has an alias.
protected string wrapSegments(array $segments)
Wrap the given value segments.
protected string wrapValue(string $value)
Wrap a single string in keyword identifiers.
string columnize(array $columns)
Convert an array of column names into a delimited string.
string parameterize(array $values)
Create query parameter place-holders for an array.
string parameter(mixed $value)
Get the appropriate query parameter place-holder for a value.
bool isExpression(mixed $value)
Determine if the given value is a raw expression.
string getValue(Expression $expression)
Get the value of a raw expression.
string getDateFormat()
Get the format for database stored dates.
string getTablePrefix()
Get the grammar's table prefix.
$this setTablePrefix(string $prefix)
Set the grammar's table prefix.
string compileSelect(Builder $query)
Compile a select query into SQL.
protected array compileComponents(Builder $query)
Compile the components necessary for a select clause.
protected string compileAggregate(Builder $query, array $aggregate)
Compile an aggregated select clause.
protected string|null compileColumns(Builder $query, array $columns)
Compile the "select *" portion of the query.
protected string compileFrom(Builder $query, string $table)
Compile the "from" portion of the query.
protected string compileJoins(Builder $query, array $joins)
Compile the "join" portions of the query.
protected string compileWheres(Builder $query)
Compile the "where" portions of the query.
protected array compileWheresToArray(Builder $query)
Get an array of all the where clauses for the query.
protected string concatenateWhereClauses(Builder $query, array $sql)
Format the where clause statements into one string.
protected string whereRaw(Builder $query, array $where)
Compile a raw where clause.
protected string whereBasic(Builder $query, array $where)
Compile a basic where clause.
protected string whereIn(Builder $query, array $where)
Compile a "where in" clause.
protected string whereNotIn(Builder $query, array $where)
Compile a "where not in" clause.
protected string whereInSub(Builder $query, array $where)
Compile a where in sub-select clause.
protected string whereNotInSub(Builder $query, array $where)
Compile a where not in sub-select clause.
protected string whereNull(Builder $query, array $where)
Compile a "where null" clause.
protected string whereNotNull(Builder $query, array $where)
Compile a "where not null" clause.
protected string whereBetween(Builder $query, array $where)
Compile a "between" where clause.
protected string whereDate(Builder $query, array $where)
Compile a "where date" clause.
protected string whereTime(Builder $query, array $where)
Compile a "where time" clause.
protected string whereDay(Builder $query, array $where)
Compile a "where day" clause.
protected string whereMonth(Builder $query, array $where)
Compile a "where month" clause.
protected string whereYear(Builder $query, array $where)
Compile a "where year" clause.
protected string dateBasedWhere(string $type, Builder $query, array $where)
Compile a date based where clause.
protected string whereColumn(Builder $query, array $where)
Compile a where clause comparing two columns.
.
protected string whereNested(Builder $query, array $where)
Compile a nested where clause.
protected string whereSub(Builder $query, array $where)
Compile a where condition with a sub-select.
protected string whereExists(Builder $query, array $where)
Compile a where exists clause.
protected string whereNotExists(Builder $query, array $where)
Compile a where exists clause.
protected string compileGroups(Builder $query, array $groups)
Compile the "group by" portions of the query.
protected string compileHavings(Builder $query, array $havings)
Compile the "having" portions of the query.
protected string compileHaving(array $having)
Compile a single having clause.
protected string compileBasicHaving(array $having)
Compile a basic having clause.
protected string compileOrders(Builder $query, array $orders)
Compile the "order by" portions of the query.
protected array compileOrdersToArray(Builder $query, array $orders)
Compile the query orders to an array.
string compileRandom(string $seed)
Compile the random statement into SQL.
protected string compileLimit(Builder $query, int $limit)
Compile the "limit" portions of the query.
protected string compileOffset(Builder $query, int $offset)
Compile the "offset" portions of the query.
protected string compileUnions(Builder $query)
Compile the "union" queries attached to the main query.
protected string compileUnion(array $union)
Compile a single union statement.
string compileExists(Builder $query)
Compile an exists statement into SQL.
string compileInsert(Builder $query, array $values)
Compile an insert statement into SQL.
string compileInsertGetId(Builder $query, array $values, string $sequence)
Compile an insert and get ID statement into SQL.
string compileUpdate(Builder $query, array $values)
Compile an update statement into SQL.
array prepareBindingsForUpdate(array $bindings, array $values)
Prepare the bindings for an update statement.
Booleans, integers, and doubles are inserted into JSON updates as raw values.
string compileDelete(Builder $query)
Compile a delete statement into SQL.
array compileTruncate(Builder $query)
Compile a truncate table statement into SQL.
protected string compileLock(Builder $query, bool|string $value)
Compile the lock into SQL.
bool supportsSavepoints()
Determine if the grammar supports savepoints.
string compileSavepoint(string $name)
Compile the SQL statement to define a savepoint.
string compileSavepointRollBack(string $name)
Compile the SQL statement to execute a savepoint rollback.
protected string concatenate(array $segments)
Concatenate an array of segments, removing empties.
protected string removeLeadingBoolean(string $value)
Remove the leading boolean from a statement.
array getOperators()
Get the grammar specific operators.
protected string compileUpdateColumns(array $values)
Compile all of the columns for an update statement.
protected string compileJsonUpdateColumn(string $key, JsonExpression $value)
Prepares a JSON column being updated using the JSON_SET function.
protected string compileDeleteWithoutJoins(Builder $query, string $table, array $where)
Compile a delete query that does not use joins.
protected string compileDeleteWithJoins(Builder $query, string $table, array $where)
Compile a delete query that uses joins.
protected string wrapJsonSelector(string $value)
Wrap the given JSON selector.
protected bool isJsonSelector(string $value)
Determine if the given string is a JSON selector.
    © Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
    https://laravel.com/api/5.5/Illuminate/Database/Query/Grammars/MySqlGrammar.html