Skip to content

Commit 181fae4

Browse files
committed
new test for booleans
1 parent 32e5569 commit 181fae4

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

database/querybuilder_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,12 @@ func TestQueryBuilder(t *testing.T) {
8989
`SELECT * FROM "table" WHERE "table"."city" = $1 AND NOT (NOT "table"."age" = $2 OR "table"."age" >= $3 AND "table"."age" <= $4)`,
9090
[]any{"milano", "14", "11", "17"},
9191
},
92+
{
93+
// complex booleans
94+
"?or=(or(and(a.eq.1,b.eq.93,c.eq.apple),and(e.eq.1,f.eq.93,g.eq.apple)),or(and(a.eq.1,b.eq.35,c.eq.apple),and(e.eq.1,f.eq.35,g.eq.apple)),or(and(a.eq.1,b.eq.25978,c.eq.apple),and(e.eq.1,f.eq.25978,g.eq.apple)))",
95+
`SELECT * FROM "table" WHERE (("table"."a" = $1 AND "table"."b" = $2 AND "table"."c" = $3 OR "table"."e" = $4 AND "table"."f" = $5 AND "table"."g" = $6) OR ("table"."a" = $7 AND "table"."b" = $8 AND "table"."c" = $9 OR "table"."e" = $10 AND "table"."f" = $11 AND "table"."g" = $12) OR ("table"."a" = $13 AND "table"."b" = $14 AND "table"."c" = $15 OR "table"."e" = $16 AND "table"."f" = $17 AND "table"."g" = $18))`,
96+
[]any{"1", "93", "apple", "1", "93", "apple", "1", "35", "apple", "1", "35", "apple", "1", "25978", "apple", "1", "25978", "apple"},
97+
},
9298
{
9399
// quotes
94100
"?&name=eq.\"Stefano,DelliPonti\"&zbackslash=eq.\"\\\\bs\\\"\"",

0 commit comments

Comments
 (0)