p
constp:object
Defined in: packages/contracts/src/predicate.ts:213
The predicate builder — the tier-① authoring surface for a native where.
Deliberately namespaced rather than exported as bare eq/and/or/not, which would collide
with drizzle-orm’s operators of the same names in exactly the files that use both (a registry
authoring RLS policies with Drizzle’s eq and a shape where with this one). The shapes are
intentionally the same so the two read alike; only the AST-versus-SQL return type differs.
where: (c) => p.and(p.eq(c.published, true), p.isNotNull(c.releasedAt))Type Declaration
Section titled “Type Declaration”
readonlyand: (…nodes) =>AndPredicate
Parameters
Section titled “Parameters”…Predicate[]
Returns
Section titled “Returns”
readonlyeq: <TCol>(column,value) =>LeafPredicate
Type Parameters
Section titled “Type Parameters”TCol extends AnyColumn
Parameters
Section titled “Parameters”column
Section titled “column”TCol
ColumnValue<TCol>
Returns
Section titled “Returns”
readonlygt: <TCol>(column,value) =>LeafPredicate
Type Parameters
Section titled “Type Parameters”TCol extends AnyColumn
Parameters
Section titled “Parameters”column
Section titled “column”TCol
ColumnValue<TCol>
Returns
Section titled “Returns”
readonlygte: <TCol>(column,value) =>LeafPredicate
Type Parameters
Section titled “Type Parameters”TCol extends AnyColumn
Parameters
Section titled “Parameters”column
Section titled “column”TCol
ColumnValue<TCol>
Returns
Section titled “Returns”
readonlyin: <TCol>(column,ref) =>InSubqueryPredicate
Type Parameters
Section titled “Type Parameters”TCol extends AnyColumn
Parameters
Section titled “Parameters”column
Section titled “column”TCol
SubqueryRef<Extract<ColumnValue<TCol>, PredicateValue>>
Returns
Section titled “Returns”isNotNull
Section titled “isNotNull”
readonlyisNotNull: (column) =>IsNullPredicate
Parameters
Section titled “Parameters”column
Section titled “column”AnyColumn
Returns
Section titled “Returns”isNull
Section titled “isNull”
readonlyisNull: (column) =>IsNullPredicate
Parameters
Section titled “Parameters”column
Section titled “column”AnyColumn
Returns
Section titled “Returns”
readonlylike: <TCol>(column,pattern) =>LeafPredicate
SQL LIKE (case-sensitive; % = any sequence, _ = any single char). Text columns only.
Type Parameters
Section titled “Type Parameters”TCol extends AnyColumn<{ data: string; }>
Parameters
Section titled “Parameters”column
Section titled “column”TCol
pattern
Section titled “pattern”string
Returns
Section titled “Returns”
readonlylt: <TCol>(column,value) =>LeafPredicate
Type Parameters
Section titled “Type Parameters”TCol extends AnyColumn
Parameters
Section titled “Parameters”column
Section titled “column”TCol
ColumnValue<TCol>
Returns
Section titled “Returns”
readonlylte: <TCol>(column,value) =>LeafPredicate
Type Parameters
Section titled “Type Parameters”TCol extends AnyColumn
Parameters
Section titled “Parameters”column
Section titled “column”TCol
ColumnValue<TCol>
Returns
Section titled “Returns”
readonlyne: <TCol>(column,value) =>LeafPredicate
Type Parameters
Section titled “Type Parameters”TCol extends AnyColumn
Parameters
Section titled “Parameters”column
Section titled “column”TCol
ColumnValue<TCol>
Returns
Section titled “Returns”
readonlynot: (node) =>NotPredicate
Parameters
Section titled “Parameters”Returns
Section titled “Returns”
readonlynotIn: <TCol>(column,ref) =>InSubqueryPredicate
Type Parameters
Section titled “Type Parameters”TCol extends AnyColumn
Parameters
Section titled “Parameters”column
Section titled “column”TCol
SubqueryRef<Extract<ColumnValue<TCol>, PredicateValue>>
Returns
Section titled “Returns”notLike
Section titled “notLike”
readonlynotLike: <TCol>(column,pattern) =>NotPredicate
SQL NOT LIKE. The engine has no negated-like op; it models it as Not(Like), so this does too.
Type Parameters
Section titled “Type Parameters”TCol extends AnyColumn<{ data: string; }>
Parameters
Section titled “Parameters”column
Section titled “column”TCol
pattern
Section titled “pattern”string
Returns
Section titled “Returns”
readonlyor: (…nodes) =>OrPredicate
Parameters
Section titled “Parameters”…Predicate[]
Returns
Section titled “Returns”subquery
Section titled “subquery”
readonlysubquery: <TCol>(projected,where?) =>SubqueryRef<Extract<ColumnValue<TCol>,PredicateValue>>
The inner set for an IN test, named by the column it projects — the table is read off that
column, so there is no table name to get wrong and no way to project a column the named table
does not have.
Type Parameters
Section titled “Type Parameters”TCol extends AnyColumn
Parameters
Section titled “Parameters”projected
Section titled “projected”TCol
where?
Section titled “where?”Returns
Section titled “Returns”SubqueryRef<Extract<ColumnValue<TCol>, PredicateValue>>