zio-sql icon indicating copy to clipboard operation
zio-sql copied to clipboard

need to be able to delete from joined tables

Open bertlebee opened this issue 5 years ago • 1 comments

split from #37

All major dialects provide some way to delete from a joined table but the table to be deleted from needs to be explicitly provided. We could specify a "zio-sql" way of doing this (with dialect specific implementations) e.g. I'd suggest

delete(orders).from((orders join users).on(fkUserId === userId)).where(fName === "Fred")

or we could just disallow this and let the dialect specific modules introduce the concept of deleting from a join in a manner similar to the dialect of choice (e.g. using for postgres)

bertlebee avatar Jun 13 '20 02:06 bertlebee

I like the proposed syntax. We should support this and translate to dialect-specific variants in the rendering.

jdegoes avatar Sep 08 '20 12:09 jdegoes