{"record":{"id":"abd500b22661e052","repo":"remix-run/remix","slug":"unsupported-operation-kind-abd500","errorCode":null,"errorMessage":"Unsupported operation kind","messagePattern":"Unsupported operation kind","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/data-table-postgres/src/lib/sql-compiler.ts","lineNumber":118,"sourceCode":"    }\n  }\n\n  if (operation.kind === 'delete') {\n    return {\n      text:\n        'delete from ' +\n        quotePath(getTableName(operation.table)) +\n        compileWhereClause(operation.where, context) +\n        compileReturningClause(operation.returning),\n      values: context.values,\n    }\n  }\n\n  if (operation.kind === 'upsert') {\n    return compileUpsertOperation(operation, context)\n  }\n\n  throw new Error('Unsupported operation kind')\n}\n\nfunction compileInsertOperation(\n  table: OperationTable,\n  values: Record<string, unknown>,\n  returning: '*' | string[] | undefined,\n  context: CompileContext,\n): SqlStatement {\n  let columns = Object.keys(values)\n\n  if (columns.length === 0) {\n    return {\n      text:\n        'insert into ' +\n        quotePath(getTableName(table)) +\n        ' default values' +\n        compileReturningClause(returning),\n      values: context.values,","sourceCodeStart":100,"sourceCodeEnd":136,"githubUrl":"https://github.com/remix-run/remix/blob/9696913134be3a4423513d2775f7b31d6917c049/packages/data-table-postgres/src/lib/sql-compiler.ts#L100-L136","documentation":"The Postgres SQL compiler dispatches on operation.kind (insert, update, delete, upsert, ...) and throws this fallback when the kind is unrecognized. It means a malformed or version-mismatched operation object reached the compiler.","triggerScenarios":"Passing an operation object with a missing/misspelled `kind` to the compile/execute path; version skew between the data-table core (which may emit new operation kinds) and the Postgres adapter; hand-built or deserialized operation objects losing their discriminant.","commonSituations":"Upgrading @remix-run/data-table without upgrading data-table-postgres; caching/serializing operations across processes; constructing operations via object literals instead of builder APIs.","solutions":["Align versions of all data-table packages and reinstall dependencies","Build operations with the library's builder APIs rather than plain objects","Log operation.kind before compiling to identify corrupted values; validate deserialized operations"],"exampleFix":"# align adapter versions\npnpm up '@remix-run/data-table*'@latest","handlingStrategy":"validation","validationCode":"const KINDS = new Set(['insert','update','delete','upsert'])\nif (!KINDS.has(op.kind)) throw new Error('Unknown operation kind: ' + op.kind)","typeGuard":"function isOperation(o: unknown): o is Operation { return !!o && typeof o === 'object' && ['insert','update','delete','upsert'].includes((o as { kind?: string }).kind ?? '') }","tryCatchPattern":null,"preventionTips":["Align data-table package versions","Use builder APIs to construct operations","Validate deserialized operations"],"tags":["postgres","sql-compiler","operation","version-mismatch"],"backgroundTag":"unsupported-operation-kind","analyzedSha":"9696913134be3a4423513d2775f7b31d6917c049","analyzedAt":"2026-08-27T19:55:01.024Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}