Closed mindplay-dk closed 5 years ago
Minor correct to the above: MySQL does support non-standard LIMIT
and ORDER BY
clauses for UPDATE
and DELETE
statements - removing these features would be a breaking change, so we should probably introduce MySQLUpdateQuery
and MySQLDeleteQuery
classes to preserve these features.
In master
now.
The documentation on the
ProjectQuery
class is very wrong.The idea that SELECT, UPDATE and DELETE queries are all "projection queries" is wrong.
The only thing these query-types have in common, is the
WHERE
clause.Only SELECT queries actually support projections, which doesn't mean much more than simply selecting which columns to include in the resulting projection.
The
ORDER
,JOIN
andLIMIT
clauses are all specific to the SELECT query-builders.Removing these features from the query-builders is technically a breaking change - however, we can safely version these changes as a bugfix, since these feature wouldn't have produced any working code in the first place.
Here's an overview of the clauses supported by all 4 query-types for PostgreSQL and MySQL:
Clauses designated
pgsql
ormysql
are specific to those query-builders.The clauses in
()
parens aren't currently supported by the query-builders.Remove the
ProjectionQuery
class, and move theWHERE
clause builder to atrait
.