kysely icon indicating copy to clipboard operation
kysely copied to clipboard

Support DELETE [TABLE] FROM [TABLE]

Open shuaixr opened this issue 3 years ago • 2 comments

When using delete with leftJoin, you need to use a syntax similar to DELETE [TABLE] FROM [TABLE], but I not found any implementation methods other than raw in the document

Discussion on stackoverflow: Deleting rows with MySQL LEFT JOIN

shuaixr avatar Nov 25 '22 05:11 shuaixr

The following syntax is equivalent to the one you've mentioned:

DELETE FROM t1, t2 USING t1 INNER JOIN t2 INNER JOIN t3 WHERE t1.id=t2.id AND t2.id=t3.id; https://dev.mysql.com/doc/refman/8.0/en/delete.html

It will be easier to implement and with less awkwardness and breaking changes. using is also supported in other databases, and was requested in #177. 2x🐦1x🗿

igalklebanov avatar Nov 26 '22 20:11 igalklebanov