diff --git a/src/db/conditions.ts b/src/db/conditions.ts index 5d0a57d..447030b 100644 --- a/src/db/conditions.ts +++ b/src/db/conditions.ts @@ -29,11 +29,11 @@ export const isNotFalse = sql`${self} IS NOT FALSE`; export const isUnknown = sql`${self} IS UNKNOWN`; export const isNotUnknown = sql`${self} IS NOT UNKNOWN`; -export const isDistinctFrom = (a: T) => sql`${self} IS DISTINCT FROM ${conditionalParam(a)}`; -export const isNotDistinctFrom = (a: T) => sql`${self} IS NOT DISTINCT FROM ${conditionalParam(a)}`; +export const isDistinctFrom = (a: T) => sql`${self} IS DISTINCT FROM ${conditionalParam(a)}`; +export const isNotDistinctFrom = (a: T) => sql`${self} IS NOT DISTINCT FROM ${conditionalParam(a)}`; -export const eq = (a: T) => sql`${self} = ${conditionalParam(a)}`; -export const ne = (a: T) => sql`${self} <> ${conditionalParam(a)}`; +export const eq = (a: T) => sql`${self} = ${conditionalParam(a)}`; +export const ne = (a: T) => sql`${self} <> ${conditionalParam(a)}`; export const gt = (a: T) => sql`${self} > ${conditionalParam(a)}`; export const gte = (a: T) => sql`${self} >= ${conditionalParam(a)}`; export const lt = (a: T) => sql`${self} < ${conditionalParam(a)}`; @@ -55,8 +55,8 @@ export const reImatch = (a: T) => sql` export const notReMatch = (a: T) => sql`${self} !~ ${conditionalParam(a)}`; export const notReImatch = (a: T) => sql`${self} !~* ${conditionalParam(a)}`; -export const isIn = (a: readonly T[]) => a.length > 0 ? sql`${self} IN (${vals(a)})` : sql`false`; -export const isNotIn = (a: readonly T[]) => a.length > 0 ? sql`${self} NOT IN (${vals(a)})` : sql`true`; +export const isIn = (a: T) => a.length > 0 ? sql`${self} IN (${vals(a)})` : sql`false`; +export const isNotIn = (a: T) => a.length > 0 ? sql`${self} NOT IN (${vals(a)})` : sql`true`; export const or = (...conditions: (SQLFragment | Whereable)[]) => sql`(${mapWithSeparator(conditions, sql` OR `, c => c)})`; export const and = (...conditions: (SQLFragment | Whereable)[]) => sql`(${mapWithSeparator(conditions, sql` AND `, c => c)})`;