{"record":{"id":"0ba089b07989f565","repo":"remix-run/remix","slug":"unsupported-predicate-0ba089","errorCode":null,"errorMessage":"Unsupported predicate","messagePattern":"Unsupported predicate","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/data-table-sqlite/src/lib/sql-compiler.ts","lineNumber":447,"sourceCode":"  if (predicate.type === 'null') {\n    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 joiner = predicate.operator === 'and' ? ' and ' : ' or '\n\n    return predicate.predicates\n      .map((child) => '(' + compilePredicate(child, context) + ')')\n      .join(joiner)\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":429,"sourceCodeEnd":465,"githubUrl":"https://github.com/remix-run/remix/blob/9696913134be3a4423513d2775f7b31d6917c049/packages/data-table-sqlite/src/lib/sql-compiler.ts#L429-L465","documentation":"compilePredicate compiles where/having/on predicates and only understands specific predicate types (comparison, logical and/or/not, etc.). Any object with an unrecognized type reaches the final throw. It's the compiler's guard against malformed or unsupported predicate trees.","triggerScenarios":"Passing a hand-built predicate with a misspelled or unknown type into where()/having()/on(); a version mismatch where the core emits a new predicate type the SQLite compiler doesn't know; nesting predicates built by different package versions.","commonSituations":"Version skew between data-table core and data-table-sqlite; constructing where clauses as raw objects instead of using the query builder helpers (eq, and, or, not).","solutions":["Build predicates exclusively with the exported helpers (eq, ne, gt, and, or, not, ...) instead of raw object literals.","Align data-table and data-table-sqlite versions to the same release.","Log/inspect the predicate tree to identify which node has the unsupported type."],"exampleFix":"// before\nwhere: { type: 'cmp', column: 'id', op: '=', value: 1 }\n\n// after\nwhere: eq(table.id, 1)","handlingStrategy":"type-guard","validationCode":"const KNOWN_PREDICATES = new Set(['comparison','and','or','not','in','between','null'])\nfunction assertPredicates(node: any) {\n  if (!KNOWN_PREDICATES.has(node?.type)) throw new Error(`Bad predicate: ${node?.type}`)\n  node.predicates?.forEach(assertPredicates)\n}","typeGuard":"function isPredicate(node: unknown): node is { type: string } {\n  return typeof node === 'object' && node !== null && typeof (node as any).type === 'string'\n}","tryCatchPattern":null,"preventionTips":["Use eq/and/or/not helpers rather than literal predicate objects.","Keep compiler and core package versions in sync."],"tags":["sqlite","predicate","where-clause","sql-compiler"],"backgroundTag":"unsupported-query-predicate","analyzedSha":"9696913134be3a4423513d2775f7b31d6917c049","analyzedAt":"2026-08-27T19:55:01.024Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}