mgutz / dat

Go Postgres Data Access Toolkit
Other
610 stars 62 forks source link

Remove Limit(1) from DeleteBuilder query #42

Closed nathanleclaire closed 7 years ago

nathanleclaire commented 8 years ago

Couldn't find it in https://github.com/mgutz/dat/blob/v1/delete.go. This code doesn't compile on master.

Does it seem sound @mgutz ?

Thanks!

GeorgeErickson commented 7 years ago

Also postgres doesn't support DELETE with a limit so this makes double sense.

The closest you could come is DELETE FROM __table__ WHERE __pk__ IN (SELECT __pk__ FROM __table__ LIMIT 1)