mirror of
https://github.com/ent/ent.git
synced 2026-04-28 21:50:56 +03:00
dialect/sql/sqljson: add {lt,lte} to predicates (#757)
This commit is contained in:
@@ -101,10 +101,12 @@ func TestWritePath(t *testing.T) {
|
||||
sqljson.ValueNEQ("a", 1, sqljson.Path("b")),
|
||||
sqljson.ValueGT("a", 1, sqljson.Path("c")),
|
||||
sqljson.ValueGTE("a", 1, sqljson.Path("d")),
|
||||
sqljson.ValueLT("a", 1, sqljson.Path("e")),
|
||||
sqljson.ValueLTE("a", 1, sqljson.Path("f")),
|
||||
),
|
||||
),
|
||||
wantQuery: `SELECT * FROM "users" WHERE "a"->'b' <> $1 OR "a"->'c' > $2 OR "a"->'d' >= $3`,
|
||||
wantArgs: []interface{}{1, 1, 1},
|
||||
wantQuery: `SELECT * FROM "users" WHERE "a"->'b' <> $1 OR "a"->'c' > $2 OR "a"->'d' >= $3 OR "a"->'e' < $4 OR "a"->'f' <= $5`,
|
||||
wantArgs: []interface{}{1, 1, 1, 1, 1},
|
||||
},
|
||||
}
|
||||
for i, tt := range tests {
|
||||
|
||||
Reference in New Issue
Block a user