MySQL: Add Where and Limit for Delete statement.

This commit is contained in:
go-jet 2019-08-11 18:23:02 +02:00
parent a3ae52c43c
commit 0dd976601e
6 changed files with 91 additions and 29 deletions

View file

@ -15,3 +15,12 @@ DELETE FROM db.table1
WHERE table1.col1 = ?;
`, int64(1))
}
func TestDeleteWithWhereOrderByLimit(t *testing.T) {
assertStatement(t, table1.DELETE().WHERE(table1Col1.EQ(Int(1))).ORDER_BY(table1Col1).LIMIT(1), `
DELETE FROM db.table1
WHERE table1.col1 = ?
ORDER BY table1.col1
LIMIT ?;
`, int64(1), int64(1))
}