Files
pgm/playground/qry_delete_test.go
2025-10-18 14:43:42 +05:30

19 lines
411 B
Go

package playground
import (
"testing"
"code.patial.tech/go/pgm/playground/db"
"code.patial.tech/go/pgm/playground/db/user"
)
func TestDelete(t *testing.T) {
expected := "DELETE FROM users WHERE users.id = $1 AND users.status_id != ANY($2)"
got := db.User.Delete().
Where(user.ID.Eq(1), user.StatusID.NotAny(1, 2, 3)).
String()
if got != expected {
t.Errorf("got %q, want %q", got, expected)
}
}