SQLServer
class SQLServer extends Compiler
Compiles SQL Server queries.
Traits
Constants
JSON_PATH_SEPARATOR |
JSON path separator. |
Properties
static protected | $dateFormat | {@inheritdoc} | |
protected Query | $query | Query builder. | from Compiler |
protected array | $params | Query parameters. | from Compiler |
Methods
Returns an escaped identifier.
Builds a JSON value getter.
Builds a JSON value setter.
Returns a comma-separated list of compiled columns.
Compiles common table expressions.
Returns raw SQL or a paramter placeholder.
Returns a comma-separated list of parameters.
Returns a comma-separated list of parameter placeholders.
Compiles the FROM clause.
Compiles date comparison clauses.
Compiles date range clauses.
Compiles ORDER BY clauses.
Compiles LIMIT clauses.
Compiles OFFSET clauses.
Details
in Compiler at line 78
static
setDateFormat(string $dateFormat)
Sets the date format.
in Compiler at line 88
static string
getDateFormat()
Gets the date format.
in Compiler at line 117
protected string
subselect(Query $query)
Compiles a subselect and merges the parameters.
in Compiler at line 133
protected string
subquery(Subquery $subquery, bool $enclose = true)
Compiles a subquery.
at line 31
string
escapeIdentifier(string $identifier)
Returns an escaped identifier.
in Compiler at line 173
string
escapeIdentifiers(array $identifiers)
Returns an array of escaped identifiers.
in Compiler at line 189
protected bool
hasJsonPath(string $string)
Does the string have a JSON path?
at line 39
protected string
buildJsonGet(string $column, array $segments)
Builds a JSON value getter.
at line 47
protected string
buildJsonSet(string $column, array $segments, string $param)
Builds a JSON value setter.
in Compiler at line 225
string
escapeTableName(string $table)
Escapes a table name.
in Compiler at line 269
string
tables(array $tables)
Returns a comma-separated list of tables.
in Compiler at line 287
string
escapeColumnName(string $column)
Escapes a column name.
in Compiler at line 312
string
columnName(string $column)
Compiles a column name.
in Compiler at line 332
string
columnNames(array $columns)
Returns a comma-separated list of column names.
in Compiler at line 351
string
column(string|Raw|Subquery $column, bool $allowAlias = false)
Compiles a column.
in Compiler at line 378
string
columns(array $columns, bool $allowAlias = false)
Returns a comma-separated list of compiled columns.
in Compiler at line 396
protected string
commonTableExpressions(array $commonTableExpressions)
Compiles common table expressions.
in Compiler at line 428
protected string
setOperations(array $setOperations)
Compiles set operations.
in Compiler at line 452
protected string
param(mixed $param, bool $enclose = true)
Returns raw SQL or a paramter placeholder.
in Compiler at line 481
protected string
params(array $params, bool $enclose = true)
Returns a comma-separated list of parameters.
in Compiler at line 499
protected string
simpleParam(mixed $param)
Returns a parameter placeholder.
in Compiler at line 512
protected string
simpleParams(array $params)
Returns a comma-separated list of parameter placeholders.
at line 55
string
from($from)
Compiles the FROM clause.
in Compiler at line 546
protected string
where(array $where)
Compiles WHERE conditions.
in Compiler at line 566
protected string
whereRaw(array $where)
Compiles a raw WHERE condition.
at line 78
protected string
whereDate(array $where)
Compiles date comparison clauses.
in Compiler at line 588
protected string
whereColumn(array $where)
Compiles column comparison clauses.
in Compiler at line 608
protected string
between(array $where)
Compiles BETWEEN clauses.
at line 70
protected string
betweenDate(array $where)
Compiles date range clauses.
in Compiler at line 630
protected string
in(array $where)
Compiles IN clauses.
in Compiler at line 643
protected string
null(array $where)
Compiles IS NULL clauses.
in Compiler at line 654
protected string
exists(array $where)
Compiles EXISTS clauses.
in Compiler at line 665
protected string
nestedWhere(array $where)
Compiles nested WHERE conditions.
in Compiler at line 676
protected string
whereConditions(array $wheres)
Compiles WHERE conditions.
in Compiler at line 698
protected string
wheres(array $wheres)
Compiles WHERE clauses.
in Compiler at line 714
protected string
joinCondition(array $condition)
Compiles a JOIN condition.
in Compiler at line 725
protected string
nestedJoinCondition(array $condition)
Compiles nested JOIN condition.
in Compiler at line 760
protected string
joins(array $joins)
Compiles JOIN clauses.
in Compiler at line 783
protected string
groupings(array $groupings)
Compiles GROUP BY clauses.
at line 86
protected string
orderings(array $orderings)
Compiles ORDER BY clauses.
in Compiler at line 817
protected string
havingCondictions(array $havings)
Compiles HAVING conditions.
in Compiler at line 839
protected string
havings(array $havings)
Compiles HAVING clauses.
at line 99
protected string
limit(int|null $limit)
Compiles LIMIT clauses.
at line 112
protected string
offset(int|null $offset)
Compiles OFFSET clauses.
in Compiler at line 877
protected string
lock(bool|string|null $lock)
Compiles locking clause.
in Compiler at line 887
array
select()
Compiles a SELECT query.
in Compiler at line 913
protected string
insertWithValues(array $values)
Returns a INSERT query with values.
in Compiler at line 928
protected string
insertWithoutValues()
Returns a INSERT query without values.
in Compiler at line 939
array
insert(array $values = [])
Compiles a INSERT query.
in Compiler at line 961
protected string
updateColumns(array $columns)
Compiles update columns.
in Compiler at line 992
array
update(array $values)
Compiles a UPDATE query.
in Compiler at line 1009
array
delete()
Compiles a DELETE query.
in JsonPathBuilderTrait at line 26
protected string
buildJsonPath(array $segments)
Builds a JSON path.