Files
pgm/example/qry_delete_test.go
2025-07-26 18:34:56 +05:30

19 lines
401 B
Go

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