Responsible for compiling a Query object into its SQL representation
array<string>
The list of query clauses to traverse for generating a DELETE statement
array<string>
The list of query clauses to traverse for generating an INSERT statement
bool
Indicate whether this query dialect supports ordered unions.
bool
Indicate whether aliases in SELECT clause need to be always quoted.
array<string>
The list of query clauses to traverse for generating a SELECT statement
array<string, string>
List of sprintf templates that will be used for compiling the SQL for this query. There are some clauses that can be built as just as the direct concatenation of the internal parts, those are listed here.
array<string>
The list of query clauses to traverse for generating an UPDATE statement
Helper function used to build the string representation of a FROM clause, it constructs the tables list taking care of aliasing and converting expression objects to string.
Builds the SQL fragment for INSERT INTO.
Helper function used to build the string representation of multiple JOIN clauses, it constructs the joins list taking care of aliasing and converting expression objects to string in both the table to be joined and the conditions to be used.
Builds the SQL modifier fragment
Helper function used to build the string representation of a SELECT clause, it constructs the field list taking care of aliasing and converting expression objects to string. This function also constructs the DISTINCT clause for the query.
Helper function to generate SQL for SET expressions.
Builds the SQL string for all the UNION clauses in this query, when dealing with query objects it will also transform them using their configured SQL dialect.
Builds the SQL fragment for UPDATE.
Builds the SQL fragment for INSERT INTO.
Helper function to build the string representation of a window clause.
Helper function used to build the string representation of a WITH
clause, it constructs the CTE definitions list and generates the RECURSIVE
keyword when required.
Returns a callable object that can be used to compile a SQL string representation of this query.
Helper function used to covert ExpressionInterface objects inside an array into their string representation.
Returns the SQL representation of the provided query after generating the placeholders for the bound values using the provided generator
_buildFromPart(array $parts, Cake\Database\Query $query, Cake\Database\ValueBinder $binder): string
Helper function used to build the string representation of a FROM clause, it constructs the tables list taking care of aliasing and converting expression objects to string.
array
$parts list of tables to be transformed to string
Cake\Database\Query
$query The query that is being compiled
Cake\Database\ValueBinder
$binder Value binder used to generate parameter placeholder
string
_buildInsertPart(array $parts, Cake\Database\Query $query, Cake\Database\ValueBinder $binder): string
Builds the SQL fragment for INSERT INTO.
array
$parts The insert parts.
Cake\Database\Query
$query The query that is being compiled
Cake\Database\ValueBinder
$binder Value binder used to generate parameter placeholder
string
_buildJoinPart(array $parts, Cake\Database\Query $query, Cake\Database\ValueBinder $binder): string
Helper function used to build the string representation of multiple JOIN clauses, it constructs the joins list taking care of aliasing and converting expression objects to string in both the table to be joined and the conditions to be used.
array
$parts list of joins to be transformed to string
Cake\Database\Query
$query The query that is being compiled
Cake\Database\ValueBinder
$binder Value binder used to generate parameter placeholder
string
_buildModifierPart(array $parts, Cake\Database\Query $query, Cake\Database\ValueBinder $binder): string
Builds the SQL modifier fragment
array
$parts The query modifier parts
Cake\Database\Query
$query The query that is being compiled
Cake\Database\ValueBinder
$binder Value binder used to generate parameter placeholder
string
_buildSelectPart(array $parts, Cake\Database\Query $query, Cake\Database\ValueBinder $binder): string
Helper function used to build the string representation of a SELECT clause, it constructs the field list taking care of aliasing and converting expression objects to string. This function also constructs the DISTINCT clause for the query.
array
$parts list of fields to be transformed to string
Cake\Database\Query
$query The query that is being compiled
Cake\Database\ValueBinder
$binder Value binder used to generate parameter placeholder
string
_buildSetPart(array $parts, Cake\Database\Query $query, Cake\Database\ValueBinder $binder): string
Helper function to generate SQL for SET expressions.
array
$parts List of keys & values to set.
Cake\Database\Query
$query The query that is being compiled
Cake\Database\ValueBinder
$binder Value binder used to generate parameter placeholder
string
_buildUnionPart(array $parts, Cake\Database\Query $query, Cake\Database\ValueBinder $binder): string
Builds the SQL string for all the UNION clauses in this query, when dealing with query objects it will also transform them using their configured SQL dialect.
array
$parts list of queries to be operated with UNION
Cake\Database\Query
$query The query that is being compiled
Cake\Database\ValueBinder
$binder Value binder used to generate parameter placeholder
string
_buildUpdatePart(array $parts, Cake\Database\Query $query, Cake\Database\ValueBinder $binder): string
Builds the SQL fragment for UPDATE.
array
$parts The update parts.
Cake\Database\Query
$query The query that is being compiled
Cake\Database\ValueBinder
$binder Value binder used to generate parameter placeholder
string
_buildValuesPart(array $parts, Cake\Database\Query $query, Cake\Database\ValueBinder $binder): string
Builds the SQL fragment for INSERT INTO.
array
$parts The values parts.
Cake\Database\Query
$query The query that is being compiled
Cake\Database\ValueBinder
$binder Value binder used to generate parameter placeholder
string
_buildWindowPart(array $parts, Cake\Database\Query $query, Cake\Database\ValueBinder $binder): string
Helper function to build the string representation of a window clause.
array
$parts List of windows to be transformed to string
Cake\Database\Query
$query The query that is being compiled
Cake\Database\ValueBinder
$binder Value binder used to generate parameter placeholder
string
_buildWithPart(array $parts, Cake\Database\Query $query, Cake\Database\ValueBinder $binder): string
Helper function used to build the string representation of a WITH
clause, it constructs the CTE definitions list and generates the RECURSIVE
keyword when required.
array
$parts List of CTEs to be transformed to string
Cake\Database\Query
$query The query that is being compiled
Cake\Database\ValueBinder
$binder Value binder used to generate parameter placeholder
string
_sqlCompiler(string $sql, Cake\Database\Query $query, Cake\Database\ValueBinder $binder): Closure
Returns a callable object that can be used to compile a SQL string representation of this query.
string
$sql initial sql string to append to
Cake\Database\Query
$query The query that is being compiled
Cake\Database\ValueBinder
$binder Value binder used to generate parameter placeholder
Closure
_stringifyExpressions(array $expressions, Cake\Database\ValueBinder $binder, bool $wrap = true): array
Helper function used to covert ExpressionInterface objects inside an array into their string representation.
array
$expressions list of strings and ExpressionInterface objects
Cake\Database\ValueBinder
$binder Value binder used to generate parameter placeholder
bool
$wrap optional Whether to wrap each expression object with parenthesis
array
compile(Cake\Database\Query $query, Cake\Database\ValueBinder $binder): string
Returns the SQL representation of the provided query after generating the placeholders for the bound values using the provided generator
Cake\Database\Query
$query The query that is being compiled
Cake\Database\ValueBinder
$binder Value binder used to generate parameter placeholders
string
The list of query clauses to traverse for generating a DELETE statement
array<string>
The list of query clauses to traverse for generating an INSERT statement
array<string>
Indicate whether this query dialect supports ordered unions.
Overridden in subclasses.
bool
Indicate whether aliases in SELECT clause need to be always quoted.
bool
The list of query clauses to traverse for generating a SELECT statement
array<string>
List of sprintf templates that will be used for compiling the SQL for this query. There are some clauses that can be built as just as the direct concatenation of the internal parts, those are listed here.
array<string, string>
The list of query clauses to traverse for generating an UPDATE statement
array<string>
© 2005–present The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/4.4/class-Cake.Database.QueryCompiler.html