From 12b5fc2a2bc7925ad5081e6e8f4db73d8090c14e Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Mon, 22 Jul 2024 21:28:44 +0100 Subject: [PATCH] add test for notequal --- .../server/src/integrations/tests/sql.spec.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/packages/server/src/integrations/tests/sql.spec.ts b/packages/server/src/integrations/tests/sql.spec.ts index 19177fb041..278c5dd1ec 100644 --- a/packages/server/src/integrations/tests/sql.spec.ts +++ b/packages/server/src/integrations/tests/sql.spec.ts @@ -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`, + }) + }) })