Renders the compiled filter AST to a Prisma where object (no driver dependency).
Text ops map to Prisma’s case-insensitive contains/startsWith/endsWith;
between (lowered upstream) → gte/lte; inArray → in; scalar-list array ops →
hasEvery/hasSome. like/ilike/notIlike are reduced to
contains/startsWith/endsWith when the pattern allows (%x%/x%/%x); only
genuinely arbitrary patterns (internal %, any _), which Prisma’s where can’t
express, throw (use $queryRaw). arrayContained (array ⊆ values) also has no Prisma
operator.
Compile a flat, AND-combined list of column filters into a Prisma where object. Only fields in spec whose kind matches the filter’s kind are kept; the rest are silently dropped. where is undefined when nothing survives, which Prisma treats as “no filter”. A date preset filter needs resolveDate (it throws without one).
Render an already-compiled CompiledWhere AST (from compileFilters / compileFilterNode in @xtandard/lib/filters) to a Prisma where object, looking each field up in fields. Conditions on fields missing from fields are dropped; null (or an AST that drops to nothing) gives undefined. and/or/not become AND/OR/NOT. Throws for arrayContained and for like/ilike patterns with an inner % or any _. Most code calls buildWhere, which compiles and renders in one step.
Allow-list a public field as an array filter over a Prisma scalar-list model field (e.g. tags String[]), named by its model field name ("tags"). arrayContains → hasEvery, arrayOverlaps → hasSome; arrayContained has no Prisma operator and throws.
Allow-list a public field as a date filter over a Prisma DateTime model field, named by its model field name ("createdAt"). A date preset needs the resolveDate you pass to buildWhere, and becomes a half-open gte/lt window.
Allow-list a public field as an enum filter (eq/ne/inArray/notInArray/null checks) over a Prisma enum or String model field, named by its model field name ("status").
Allow-list a public field as a text filter over a Prisma String model field, named by its model field name ("name"). contains/startsWith/endsWith map to Prisma’s operators with mode: "insensitive"; like/ilike patterns that Prisma can’t express throw.