ConstCreates an OpsStatement using the = operator for strict equality.
Creates an OpsStatement with an arbitrary Kysely comparison operator or trigram operator.
Use this as an escape hatch when none of the named helpers cover your use case.
Creates an OpsStatement using the > operator.
Creates an OpsStatement using the >= operator.
Creates an OpsStatement using the SQL ILIKE operator for case-insensitive pattern matching.
Use % as a wildcard in the pattern string.
User-supplied patterns: the value is bound as a parameter (no SQL
injection), but %, _, and \ in the bound value are still interpreted
as wildcards by the SQL engine. Wrap user input with ops.like.escape
if you need literal matching.
Creates an OpsStatement for a SQL IN clause, matching rows whose column value
is one of the provided array elements.
Creates an OpsStatement that checks whether a JSONB column contains the given object
using the PostgreSQL @> (contains) operator.
Creates an OpsStatement using the < operator.
Creates an OpsStatement using the <= operator.
Creates an OpsStatement using the SQL LIKE operator for case-sensitive pattern matching.
Use % as a wildcard in the pattern string.
User-supplied patterns: the value is bound as a parameter (no SQL
injection), but %, _, and \ in the bound value are still interpreted
as wildcards by the SQL engine. Wrap user input with ops.like.escape
if you need literal matching:
User.where({ name: ops.like(`%${ops.like.escape(query)}%`) })
ops.like.escape escapes the three metacharacters that PostgreSQL's
LIKE / ILIKE operators treat as wildcards (\, %, _) so the
returned string matches literally. The same helper applies to all four
LIKE-family ops (like, ilike, not.like, not.ilike); it is exposed
here as the canonical entry point. If a caller uses ESCAPE '...' with
a non-default character this helper will not be appropriate.
Creates an OpsStatement that matches a column against a POSIX regular expression.
By default the match is case-sensitive (~); pass { caseInsensitive: true } to use ~*.
Negated variants of the standard comparison operators.
Creates an OpsStatement using the != operator for inequality.
Creates an OpsStatement that negates >, equivalent to <=.
Creates an OpsStatement that negates >=, equivalent to <.
Creates an OpsStatement using the NOT ILIKE operator for case-insensitive pattern exclusion.
User-supplied patterns: see the note on ops.ilike. Wrap user input
with ops.like.escape for literal matching.
Creates an OpsStatement for a SQL NOT IN clause, excluding rows whose column value
is one of the provided array elements.
Creates an OpsStatement that negates <, equivalent to >=.
Creates an OpsStatement that negates <=, equivalent to >.
Creates an OpsStatement using the NOT LIKE operator for case-sensitive pattern exclusion.
User-supplied patterns: see the note on ops.like. Wrap user input
with ops.like.escape for literal matching.
Creates an OpsStatement that excludes rows matching a POSIX regular expression.
By default the match is case-sensitive (!~); pass { caseInsensitive: true } to use !~*.
Creates an OpsStatement for PostgreSQL trigram similarity (% operator).
Rows are included when the similarity score meets or exceeds score.
Requires the pg_trgm extension to be enabled.
Creates an OpsStatement for PostgreSQL strict word similarity (<<% operator).
Rows are included when the strict word similarity score meets or exceeds score.
Requires the pg_trgm extension to be enabled.
Creates an OpsStatement for PostgreSQL word similarity (<% operator).
Rows are included when the word similarity score meets or exceeds score.
Requires the pg_trgm extension to be enabled.
Creates a
CurriedOpsStatementthat checks whether a PostgreSQL array column contains the given value using@> ARRAY[value]::type. The column type is resolved at query-build time from the Dream model's schema.Throws
AnyRequiresArrayColumnif the target column is not a database array type.