Skip to main content

Module feature

Module feature 

Source
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 interfaceRust trait
Feature\LockingLocking
Feature\TransactionsTransactions
Feature\StatisticalAggregatesStatisticalAggregates
Feature\BitwiseAggregatesBitwiseAggregates
Feature\RawSqlRawSql
Feature\CrossJoinsCrossJoins
Feature\FullOuterJoinsFullOuterJoins
Feature\LateralJoinsLateralJoins
Feature\JsonJson
Feature\HintsHints
Feature\ConditionalAggregatesConditionalAggregates
Feature\StringAggregatesStringAggregates
Feature\Rollup, Feature\Cube, Feature\TotalsRollup, Cube, Totals
Feature\SpatialSpatial
Feature\FullTextSearch, Feature\NegatedFullTextSearchFullTextSearch, NegatedFullTextSearch
Feature\Upsert, Feature\UpsertSelect, Feature\InsertOrIgnoreUpsert, UpsertSelect, InsertOrIgnore
Feature\TableSamplingTableSampling
Feature\SequencesSequences
Feature\MariaDB\Returning, Feature\PostgreSQL\ReturningReturning

Traits§

BitwiseAggregates
BIT_AND, BIT_OR, BIT_XOR.
ConditionalAggregates
COUNT(CASE WHEN ... THEN 1 END) and the other conditional aggregates.
CrossJoins
CROSS JOIN and NATURAL JOIN.
Cube
GROUP BY CUBE(...) / WITH CUBE.
FullOuterJoins
FULL OUTER JOIN.
FullTextSearch
filterSearch(): full-text search.
Hints
Optimizer hints.
InsertOrIgnore
insertOrIgnore().
Json
JSON filters and JSON column updates.
LateralJoins
JOIN LATERAL (subquery).
Locking
FOR UPDATE, FOR SHARE and their SKIP LOCKED / NOWAIT forms.
NegatedFullTextSearch
filterNotSearch().
RawSql
Raw SQL in select, where, group, having and order clauses, casts, CASE expressions and raw assignments.
Returning
RETURNING after inserts, updates and deletes.
Rollup
GROUP BY ... WITH ROLLUP / ROLLUP(...).
Sequences
nextVal() and currVal() of sequences.
Spatial
Spatial filters.
StatisticalAggregates
STDDEV, VARIANCE and their population/sample forms.
StringAggregates
GROUP_CONCAT / STRING_AGG, JSON_ARRAYAGG, JSON_OBJECTAGG.
TableSampling
TABLESAMPLE / SAMPLE.
Totals
WITH TOTALS (ClickHouse).
Transactions
BEGIN, COMMIT, ROLLBACK and savepoints.
Upsert
upsert().
UpsertSelect
upsertSelect().