Skip to content

WhereClause

WhereClause = (columns, user, lookups) => DrizzleSQL | undefined

Defined in: packages/permissions/src/types.ts:186

A function that produces a Drizzle WHERE clause for row-level permission filtering.

Record<string, unknown>

The table’s column references for building filter expressions.

unknown

The current user object (from @cfast/auth).

Record<string, unknown>

Resolved values from the grant’s with map (see Grant.with). Empty object when the grant declares no with map. Each key holds the awaited result of the lookup function with the same name.

DrizzleSQL | undefined

A Drizzle SQL expression to restrict matching rows, or undefined for no restriction.