add test for notequal

This commit is contained in:
Martin McKeaveney 2024-07-22 21:28:44 +01:00
parent 9035674f00
commit 12b5fc2a2b
1 changed files with 17 additions and 0 deletions

View File

@ -285,4 +285,21 @@ describe("SQL query builder", () => {
sql: `select * from (select * from (select * from (select * from "test" where "test"."name" = :1 order by "test"."id" asc) where rownum <= :2) "test" order by "test"."id" asc) where rownum <= :3`,
})
})
it("should use a direct equality query for oracle when using the not equals filter", () => {
let query = new Sql(SqlClient.ORACLE, limit)._query(
generateReadJson({
filters: {
notEqual: {
name: "John",
},
},
})
)
expect(query).toEqual({
bindings: ["John", limit, 5000],
sql: `select * from (select * from (select * from (select * from "test" where "test"."name" != :1 order by "test"."id" asc) where rownum <= :2) "test" order by "test"."id" asc) where rownum <= :3`,
})
})
})