{"record":{"id":"1cde3929808213ee","repo":"remix-run/remix","slug":"unsupported-operation-kind","errorCode":null,"errorMessage":"Unsupported operation kind","messagePattern":"Unsupported operation kind","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/data-table-mysql/src/lib/sql-compiler.ts","lineNumber":113,"sourceCode":"      values: context.values,\n    }\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      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  context: CompileContext,\n): SqlStatement {\n  let columns = Object.keys(values)\n\n  if (columns.length === 0) {\n    return {\n      text: 'insert into ' + quotePath(getTableName(table)) + ' () values ()',\n      values: context.values,\n    }\n  }\n\n  return {\n    text:","sourceCodeStart":95,"sourceCodeEnd":131,"githubUrl":"https://github.com/remix-run/remix/blob/9696913134be3a4423513d2775f7b31d6917c049/packages/data-table-mysql/src/lib/sql-compiler.ts#L95-L131","documentation":"compileMysqlOperation is the exhaustive tail of a switch over operation.kind for the MySQL SQL compiler: it handles known kinds (insert, update, delete, upsert, etc.) and throws 'Unsupported operation kind' for anything else. Seeing it means an operation object reached the compiler with a kind the MySQL backend does not implement — usually a new/typo kind or a cross-backend operation object.","triggerScenarios":"Passing a hand-constructed operation like { kind: 'merge', ... } or { kind: 'bulkInsert' } to driver compile/execute APIs; mixing operation builders from a different data-table backend (postgres) with the MySQL driver; typos in kind strings.","commonSituations":"Version mismatch where a newer @remix-run/data-table core emits a kind the installed MySQL compiler doesn't know; custom operation construction instead of using builder APIs; copying operation examples from another backend's docs.","solutions":["Use the official operation builder functions for the MySQL driver instead of hand-built objects","Align versions of the data-table core package and the MySQL backend package","Check the operation.kind against the MySQL compiler's supported kinds before compiling"],"exampleFix":"// before\nconst op = { kind: 'merge', table: 'users', values } // unsupported kind\nawait driver.execute(compile(op))\n// after\nconst op = upsertOp('users', values, { update: values })\nawait driver.execute(compile(op))","handlingStrategy":"type-guard","validationCode":"const supported = new Set(['insert', 'update', 'delete', 'upsert'])\nif (!supported.has(op.kind)) throw new Error(`unsupported kind ${op.kind} for MySQL`)","typeGuard":"type MysqlOperationKind = 'insert' | 'update' | 'delete' | 'upsert'\nfunction isMysqlOperation(op: { kind: string }): op is { kind: MysqlOperationKind } {\n  return ['insert', 'update', 'delete', 'upsert'].includes(op.kind)\n}","tryCatchPattern":"try { const sql = compileMysqlOperation(op, ctx) } catch (e) { if (e instanceof Error && e.message === 'Unsupported operation kind') { /* rebuild op with supported builder */ } throw e }","preventionTips":["Always build operations via the driver's builder APIs","Keep data-table core and MySQL backend package versions in sync"],"tags":["data-table","mysql","sql-compiler","operation"],"backgroundTag":"unsupported-operation-kind","analyzedSha":"9696913134be3a4423513d2775f7b31d6917c049","analyzedAt":"2026-08-27T19:55:01.024Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}