{"record":{"id":"9eb6461990a9352d","repo":"remix-run/remix","slug":"unknown-query-execution-mode","errorCode":null,"errorMessage":"Unknown query execution mode","messagePattern":"Unknown query execution mode","errorType":"exception","errorClass":"DataTableQueryError","httpStatus":null,"severity":"error","filePath":"packages/data-table/src/lib/database/query-execution.ts","lineNumber":119,"sourceCode":"        snapshot.plan.changes as Record<string, unknown>,\n        snapshot.plan.options,\n      )) as QueryExecutionResult<input>\n    case 'delete':\n      return (await executeDelete(\n        database,\n        snapshot.table,\n        snapshot.state,\n        snapshot.plan.options,\n      )) as QueryExecutionResult<input>\n    case 'upsert':\n      return (await executeUpsert(\n        database,\n        snapshot.table,\n        snapshot.plan.values as Record<string, unknown>,\n        snapshot.plan.options,\n      )) as QueryExecutionResult<input>\n    default:\n      throw new DataTableQueryError('Unknown query execution mode')\n  }\n}\n\nexport async function loadRowsWithRelationsForQuery(\n  database: QueryExecutionContext,\n  input: AnyQuery,\n): Promise<Record<string, unknown>[]> {\n  let snapshot = input[querySnapshot]()\n  return loadRowsWithRelationsForState(database, snapshot.table, snapshot.state)\n}\n\nexport async function loadRowsWithRelationsForState(\n  database: QueryExecutionContext,\n  table: AnyTable,\n  state: QueryState,\n): Promise<Record<string, unknown>[]> {\n  let operation = createSelectOperation(table, state)\n  let result = await database[executeOperation](operation)","sourceCodeStart":101,"sourceCodeEnd":137,"githubUrl":"https://github.com/remix-run/remix/blob/9696913134be3a4423513d2775f7b31d6917c049/packages/data-table/src/lib/database/query-execution.ts#L101-L137","documentation":"executeQuery dispatches on the query plan's execution mode with a switch statement; this error is the default branch. It means the plan contained an operation string the current version of the library does not recognize, which can only happen if plans are serialized/cached across versions or constructed manually. It is effectively an internal invariant violation rather than a user input error.","triggerScenarios":"Passing a hand-constructed or deserialized query/snapshot whose plan.mode is not one of the supported modes; replaying a query snapshot persisted by an older/newer version of @remix-run/data-table with a different mode enum.","commonSituations":"Caching or storing query plans in a session/cookie/DB and replaying them after upgrading or downgrading the package; forking or monkey-patching the query builder and introducing a new mode without extending executeQuery.","solutions":["Regenerate the query via the normal builder API instead of replaying a stored snapshot","If you persist snapshots, version-stamp them and invalidate after upgrading @remix-run/data-table","If you maintain a fork, add a matching case for your custom mode in executeQuery"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"let supported = new Set(['select', 'insert', 'insertMany', 'update', 'delete', 'upsert'])\nif (!supported.has(plan.mode)) throw new Error('Unsupported mode: ' + plan.mode)","typeGuard":"function isKnownExecutionMode(mode: string): boolean {\n  return ['select','insert','insertMany','update','delete','upsert'].includes(mode)\n}","tryCatchPattern":"try {\n  await executeQuery(database, snapshot)\n} catch (error) {\n  if (error instanceof DataTableQueryError && error.message === 'Unknown query execution mode') {\n    // regenerate the query with the current builder and retry once\n  } else throw error\n}","preventionTips":["Never persist query snapshots across deployments; build queries at request time","Version-stamp any cached plans and invalidate on package upgrades","Treat hitting this error as a signal of version skew, not user input"],"tags":["data-table","internal","query-plan","version-mismatch"],"backgroundTag":"unsupported-enum-value-dispatch","analyzedSha":"9696913134be3a4423513d2775f7b31d6917c049","analyzedAt":"2026-08-27T19:55:01.024Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}