squirrel
squirrel copied to clipboard
Support for JOIN in DELETE or UPDATE
How can I generate a query like this using https://github.com/Masterminds/squirrel:
DELETE m
FROM mainschema.maintable AS m
LEFT JOIN (SELECT stagingid
FROM stagingschema.stagingtable
WHERE versionid= ?) AS s
ON m.mainid = s.stagingid
WHERE m.id = id
AND s.stagingid IS NULL
I'm asking this because
https://github.com/Masterminds/squirrel/blob/master/delete.go
doesn't have a LeftJoin method like
https://github.com/Masterminds/squirrel/blob/master/select.go#L298
Any updates on this?
This would be useful!