Expand description
What only some dialects can do: each feature is a trait a dialect
implements, and Builder has the feature’s methods for the dialects
that implement it (so MySql::new().hint(...) compiles and a ClickHouse
builder has prewhere, while a MongoDB builder has neither).
PHP: the interfaces of Utopia\Query\Builder\Feature (and their traits),
which the builder classes implement.
| PHP interface | Rust trait |
|---|---|
Feature\Locking | Locking |
Feature\Transactions | Transactions |
Feature\StatisticalAggregates | StatisticalAggregates |
Feature\BitwiseAggregates | BitwiseAggregates |
Feature\RawSql | RawSql |
Feature\CrossJoins | CrossJoins |
Feature\FullOuterJoins | FullOuterJoins |
Feature\LateralJoins | LateralJoins |
Feature\Json | Json |
Feature\Hints | Hints |
Feature\ConditionalAggregates | ConditionalAggregates |
Feature\StringAggregates | StringAggregates |
Feature\Rollup, Feature\Cube, Feature\Totals | Rollup, Cube, Totals |
Feature\Spatial | Spatial |
Feature\FullTextSearch, Feature\NegatedFullTextSearch | FullTextSearch, NegatedFullTextSearch |
Feature\Upsert, Feature\UpsertSelect, Feature\InsertOrIgnore | Upsert, UpsertSelect, InsertOrIgnore |
Feature\TableSampling | TableSampling |
Feature\Sequences | Sequences |
Feature\MariaDB\Returning, Feature\PostgreSQL\Returning | Returning |
Traits§
- Bitwise
Aggregates BIT_AND,BIT_OR,BIT_XOR.- Conditional
Aggregates COUNT(CASE WHEN ... THEN 1 END)and the other conditional aggregates.- Cross
Joins CROSS JOINandNATURAL JOIN.- Cube
GROUP BY CUBE(...)/WITH CUBE.- Full
Outer Joins FULL OUTER JOIN.- Full
Text Search filterSearch(): full-text search.- Hints
- Optimizer hints.
- Insert
OrIgnore insertOrIgnore().- Json
- JSON filters and JSON column updates.
- Lateral
Joins JOIN LATERAL (subquery).- Locking
FOR UPDATE,FOR SHAREand theirSKIP LOCKED/NOWAITforms.- Negated
Full Text Search filterNotSearch().- RawSql
- Raw SQL in select, where, group, having and order clauses, casts,
CASEexpressions and raw assignments. - Returning
RETURNINGafter inserts, updates and deletes.- Rollup
GROUP BY ... WITH ROLLUP/ROLLUP(...).- Sequences
nextVal()andcurrVal()of sequences.- Spatial
- Spatial filters.
- Statistical
Aggregates STDDEV,VARIANCEand their population/sample forms.- String
Aggregates GROUP_CONCAT/STRING_AGG,JSON_ARRAYAGG,JSON_OBJECTAGG.- Table
Sampling TABLESAMPLE/SAMPLE.- Totals
WITH TOTALS(ClickHouse).- Transactions
BEGIN,COMMIT,ROLLBACKand savepoints.- Upsert
upsert().- Upsert
Select upsertSelect().