{"record":{"id":"fbe137a5ad5e8217","repo":"remix-run/remix","slug":"unsupported-predicate-fbe137","errorCode":null,"errorMessage":"Unsupported predicate","messagePattern":"Unsupported predicate","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/data-table-postgres/src/lib/sql-compiler.ts","lineNumber":688,"sourceCode":"    return (\n      quotePath(predicate.column) + (predicate.operator === 'isNull' ? ' is null' : ' is not null')\n    )\n  }\n\n  if (predicate.type === 'logical') {\n    if (predicate.predicates.length === 0) {\n      return predicate.operator === 'and' ? '1 = 1' : '1 = 0'\n    }\n\n    let childOperator = predicate.operator === 'and' ? ' and ' : ' or '\n    let childPredicates = predicate.predicates\n      .map((child) => '(' + compilePredicate(child, context) + ')')\n      .join(childOperator)\n\n    return childPredicates\n  }\n\n  throw new Error('Unsupported predicate')\n}\n\nfunction compileComparisonValue(\n  predicate: Extract<Predicate, { type: 'comparison' }>,\n  context: CompileContext,\n): string {\n  if (predicate.valueType === 'column') {\n    return quotePath(predicate.value)\n  }\n\n  return pushValue(context, predicate.value)\n}\n\nfunction normalizeJoinType(type: string): string {\n  return normalizeJoinTypeHelper(type)\n}\n\nfunction quoteIdentifier(value: string): string {","sourceCodeStart":670,"sourceCodeEnd":706,"githubUrl":"https://github.com/remix-run/remix/blob/9696913134be3a4423513d2775f7b31d6917c049/packages/data-table-postgres/src/lib/sql-compiler.ts#L670-L706","documentation":"The Postgres SQL compiler's predicate walker handles comparison and logical (and/or/not) predicates; any predicate object with an unrecognized `type` falls through to this throw. It indicates a malformed predicate or version mismatch between core and Postgres adapter.","triggerScenarios":"Passing where/having/join predicates with missing or unknown `type` discriminants; a newer core package emitting predicate kinds the installed postgres compiler doesn't handle; predicates reconstructed from JSON that lost their type field.","commonSituations":"Hand-rolled predicate objects; partial upgrades across the monorepo; IPC/serialization round-trips stripping fields.","solutions":["Build predicates with the builder helpers (eq, and, or, not, ...)","Align all data-table package versions","Validate predicate.type against known kinds before passing to where/having"],"exampleFix":"// before\n.where({ column: 'email', value: 'a@b.c' } as any) // no type → throws\n\n// after\n.where(eq('email', 'a@b.c'))","handlingStrategy":"validation","validationCode":"const PREDICATE_TYPES = new Set(['comparison','and','or','not'])\nif (!PREDICATE_TYPES.has((predicate as any).type)) { /* rebuild via builder */ }","typeGuard":"function isPredicate(p: unknown): p is Predicate { return !!p && typeof p === 'object' && ['comparison','and','or','not'].includes((p as { type?: string }).type ?? '') }","tryCatchPattern":null,"preventionTips":["Use builder helpers for where/having predicates","Keep package versions in sync","Validate round-tripped predicate objects"],"tags":["postgres","sql-compiler","predicate","query-builder"],"backgroundTag":"invalid-query-predicate","analyzedSha":"9696913134be3a4423513d2775f7b31d6917c049","analyzedAt":"2026-08-27T19:55:01.024Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}