Skip to content

p

const p: 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))

readonly and: (…nodes) => AndPredicate

…Predicate[]

AndPredicate

readonly eq: <TCol>(column, value) => LeafPredicate

TCol extends AnyColumn

TCol

ColumnValue<TCol>

LeafPredicate

readonly gt: <TCol>(column, value) => LeafPredicate

TCol extends AnyColumn

TCol

ColumnValue<TCol>

LeafPredicate

readonly gte: <TCol>(column, value) => LeafPredicate

TCol extends AnyColumn

TCol

ColumnValue<TCol>

LeafPredicate

readonly in: <TCol>(column, ref) => InSubqueryPredicate

TCol extends AnyColumn

TCol

SubqueryRef<Extract<ColumnValue<TCol>, PredicateValue>>

InSubqueryPredicate

readonly isNotNull: (column) => IsNullPredicate

AnyColumn

IsNullPredicate

readonly isNull: (column) => IsNullPredicate

AnyColumn

IsNullPredicate

readonly like: <TCol>(column, pattern) => LeafPredicate

SQL LIKE (case-sensitive; % = any sequence, _ = any single char). Text columns only.

TCol extends AnyColumn<{ data: string; }>

TCol

string

LeafPredicate

readonly lt: <TCol>(column, value) => LeafPredicate

TCol extends AnyColumn

TCol

ColumnValue<TCol>

LeafPredicate

readonly lte: <TCol>(column, value) => LeafPredicate

TCol extends AnyColumn

TCol

ColumnValue<TCol>

LeafPredicate

readonly ne: <TCol>(column, value) => LeafPredicate

TCol extends AnyColumn

TCol

ColumnValue<TCol>

LeafPredicate

readonly not: (node) => NotPredicate

Predicate

NotPredicate

readonly notIn: <TCol>(column, ref) => InSubqueryPredicate

TCol extends AnyColumn

TCol

SubqueryRef<Extract<ColumnValue<TCol>, PredicateValue>>

InSubqueryPredicate

readonly notLike: <TCol>(column, pattern) => NotPredicate

SQL NOT LIKE. The engine has no negated-like op; it models it as Not(Like), so this does too.

TCol extends AnyColumn<{ data: string; }>

TCol

string

NotPredicate

readonly or: (…nodes) => OrPredicate

…Predicate[]

OrPredicate

readonly subquery: <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.

TCol extends AnyColumn

TCol

Predicate

SubqueryRef<Extract<ColumnValue<TCol>, PredicateValue>>