{"record":{"id":"649ee32a88d54705","repo":"remix-run/remix","slug":"unsupported-predicate","errorCode":null,"errorMessage":"Unsupported predicate","messagePattern":"Unsupported predicate","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/data-table-mysql/src/lib/sql-compiler.ts","lineNumber":405,"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":387,"sourceCodeEnd":423,"githubUrl":"https://github.com/remix-run/remix/blob/9696913134be3a4423513d2775f7b31d6917c049/packages/data-table-mysql/src/lib/sql-compiler.ts#L387-L423","documentation":"Thrown by the MySQL SQL compiler when a predicate object passed to where/having/on does not match any known predicate type (comparison, logical combination like and/or, etc.). The compiler exhaustively switches over predicate shapes and this is the fallback for unrecognized `type` values. It almost always indicates a malformed or hand-constructed predicate object rather than one built by the library's query builder.","triggerScenarios":"Calling query builder APIs (where, having, join conditions) with a predicate whose `type` field is missing, misspelled, or a newly added variant the installed compiler version doesn't handle; also passing raw objects like `{ column: 'x', equals: 1 }` instead of builder-produced predicates, or a mismatched package version between data-table core and the MySQL adapter.","commonSituations":"Hand-writing predicate objects instead of using the builder; upgrading one data-table package but not the MySQL adapter so a new predicate kind is passed through; serializing/deserializing predicates (e.g. over IPC or JSON) and losing or corrupting the discriminant `type` field.","solutions":["Build predicates with the library's own builder functions (e.g. eq/and/or helpers) instead of plain object literals","Check the predicate's `type` field at runtime and log the offending object to find the malformed value","Ensure all @remix-run/data-table* packages are on the same version (align versions in package.json and reinstall)","If deserializing predicates, validate the reconstructed shape before passing to where/having"],"exampleFix":"// before\ntable.select().where({ type: 'comparision', column: 'id', op: '=', value: 1 } as any)\n\n// after\nimport { eq } from 'remix/data-table'\ntable.select().where(eq('id', 1))","handlingStrategy":"validation","validationCode":"const PREDICATE_TYPES = new Set(['comparison','and','or','not'])\nfunction isValidPredicate(p: unknown): boolean {\n  return !!p && typeof p === 'object' && PREDICATE_TYPES.has((p as any).type)\n}","typeGuard":"function isPredicate(p: unknown): p is Predicate {\n  return (\n    !!p && typeof p === 'object' &&\n    ['comparison','and','or','not'].includes((p as { type?: string }).type ?? '')\n  )\n}","tryCatchPattern":"catch (e) { if (e instanceof Error && e.message === 'Unsupported predicate') { console.error('Malformed predicate', predicate); throw e } throw e }","preventionTips":["Always build predicates with the library's builder helpers","Keep all data-table package versions aligned","Validate deserialized predicates before use"],"tags":["mysql","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"}