SqlServerGrammar
class SqlServerGrammar extends Grammar
Properties
protected string | $tablePrefix | The grammar table prefix. |
from Grammar |
protected array | $operators | All of the available clause operators. |
|
protected array | $selectComponents | The components that make up a select clause. |
from Grammar |
Methods
Wrap a value that has an alias.
Wrap a single string in keyword identifiers.
Convert an array of column names into a delimited string.
Get the appropriate query parameter place-holder for a value.
Get the format for database stored dates.
Format the where clause statements into one string.
Compile the random statement into SQL.
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.
Create a full ANSI offset clause for the query.
Compile the over statement for a table expression.
Compile a delete statement with joins into SQL.
Get the table and alias for the given table.
Wrap a table in keyword identifiers.
Details
in
Grammar at line 22
array
wrapArray(array $values)
Wrap an array of values.
at line 423
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.
at line 412
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.
at line 401
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 27
string
compileSelect(Builder $query)
Compile a select query into SQL.
in
Grammar at line 74
protected array
compileComponents(Builder $query)
Compile the components necessary for a select clause.
in
Grammar at line 99
protected string
compileAggregate(Builder $query, array $aggregate)
Compile an aggregated select clause.
at line 52
protected string|null
compileColumns(Builder $query, array $columns)
Compile the "select *" portion of the query.
at line 77
protected string
compileFrom(Builder $query, string $table)
Compile the "from" portion of the query.
in
Grammar at line 153
protected string
compileJoins(Builder $query, array $joins)
Compile the "join" portions of the query.
in
Grammar at line 168
protected string
compileWheres(Builder $query)
Compile the "where" portions of the query.
in
Grammar at line 193
protected array
compileWheresToArray(Builder $query)
Get an array of all the where clauses for the query.
in
Grammar at line 207
protected string
concatenateWhereClauses(Builder $query, array $sql)
Format the where clause statements into one string.
in
Grammar at line 221
protected string
whereRaw(Builder $query, array $where)
Compile a raw where clause.
in
Grammar at line 233
protected string
whereBasic(Builder $query, array $where)
Compile a basic where clause.
in
Grammar at line 247
protected string
whereIn(Builder $query, array $where)
Compile a "where in" clause.
in
Grammar at line 263
protected string
whereNotIn(Builder $query, array $where)
Compile a "where not in" clause.
in
Grammar at line 279
protected string
whereInSub(Builder $query, array $where)
Compile a where in sub-select clause.
in
Grammar at line 291
protected string
whereNotInSub(Builder $query, array $where)
Compile a where not in sub-select clause.
in
Grammar at line 303
protected string
whereNull(Builder $query, array $where)
Compile a "where null" clause.
in
Grammar at line 315
protected string
whereNotNull(Builder $query, array $where)
Compile a "where not null" clause.
in
Grammar at line 327
protected string
whereBetween(Builder $query, array $where)
Compile a "between" where clause.
at line 99
protected string
whereDate(Builder $query, array $where)
Compile a "where date" clause.
in
Grammar at line 353
protected string
whereTime(Builder $query, array $where)
Compile a "where time" clause.
in
Grammar at line 365
protected string
whereDay(Builder $query, array $where)
Compile a "where day" clause.
in
Grammar at line 377
protected string
whereMonth(Builder $query, array $where)
Compile a "where month" clause.
in
Grammar at line 389
protected string
whereYear(Builder $query, array $where)
Compile a "where year" clause.
in
Grammar at line 402
protected string
dateBasedWhere(string $type, Builder $query, array $where)
Compile a date based where clause.
in
Grammar at line 416
protected string
whereColumn(Builder $query, array $where)
Compile a where clause comparing two columns.
.
in
Grammar at line 428
protected string
whereNested(Builder $query, array $where)
Compile a nested where clause.
in
Grammar at line 445
protected string
whereSub(Builder $query, array $where)
Compile a where condition with a sub-select.
in
Grammar at line 459
protected string
whereExists(Builder $query, array $where)
Compile a where exists clause.
in
Grammar at line 471
protected string
whereNotExists(Builder $query, array $where)
Compile a where exists clause.
in
Grammar at line 483
protected string
compileGroups(Builder $query, array $groups)
Compile the "group by" portions of the query.
in
Grammar at line 495
protected string
compileHavings(Builder $query, array $havings)
Compile the "having" portions of the query.
in
Grammar at line 508
protected string
compileHaving(array $having)
Compile a single having clause.
in
Grammar at line 526
protected string
compileBasicHaving(array $having)
Compile a basic having clause.
in
Grammar at line 542
protected string
compileOrders(Builder $query, array $orders)
Compile the "order by" portions of the query.
in
Grammar at line 558
protected array
compileOrdersToArray(Builder $query, array $orders)
Compile the query orders to an array.
at line 187
string
compileRandom(string $seed)
Compile the random statement into SQL.
at line 199
protected string
compileLimit(Builder $query, int $limit)
Compile the "limit" portions of the query.
at line 211
protected string
compileOffset(Builder $query, int $offset)
Compile the "offset" portions of the query.
in
Grammar at line 608
protected string
compileUnions(Builder $query)
Compile the "union" queries attached to the main query.
in
Grammar at line 637
protected string
compileUnion(array $union)
Compile a single union statement.
at line 234
string
compileExists(Builder $query)
Compile an exists statement into SQL.
in
Grammar at line 664
string
compileInsert(Builder $query, array $values)
Compile an insert statement into SQL.
in
Grammar at line 695
string
compileInsertGetId(Builder $query, array $values, string $sequence)
Compile an insert and get ID statement into SQL.
at line 296
string
compileUpdate(Builder $query, array $values)
Compile an update statement into SQL.
at line 352
array
prepareBindingsForUpdate(array $bindings, array $values)
Prepare the bindings for an update statement.
at line 249
string
compileDelete(Builder $query)
Compile a delete statement into SQL.
at line 284
array
compileTruncate(Builder $query)
Compile a truncate table statement into SQL.
at line 223
protected string
compileLock(Builder $query, bool|string $value)
Compile the lock into SQL.
at line 369
bool
supportsSavepoints()
Determine if the grammar supports savepoints.
at line 380
string
compileSavepoint(string $name)
Compile the SQL statement to define a savepoint.
at line 391
string
compileSavepointRollBack(string $name)
Compile the SQL statement to execute a savepoint rollback.
in
Grammar at line 825
protected string
concatenate(array $segments)
Concatenate an array of segments, removing empties.
in
Grammar at line 838
protected string
removeLeadingBoolean(string $value)
Remove the leading boolean from a statement.
in
Grammar at line 848
array
getOperators()
Get the grammar specific operators.
at line 113
protected string
compileAnsiOffset(Builder $query, array $components)
Create a full ANSI offset clause for the query.
at line 143
protected string
compileOver(string $orderings)
Compile the over statement for a table expression.
at line 155
protected string
compileTableExpression(string $sql, Builder $query)
Compile a common table expression for a query.
at line 168
protected string
compileRowConstraint(Builder $query)
Compile the limit / offset row constraint for a query.
at line 268
protected string
compileDeleteWithJoins(Builder $query, string $table, string $where)
Compile a delete statement with joins into SQL.
at line 334
protected array
parseUpdateTable(string $table)
Get the table and alias for the given table.
at line 434
protected string
wrapTableValuedFunction(string $table)
Wrap a table in keyword identifiers.