{"record":{"id":"088a9664b7a0e9bf","repo":"remix-run/remix","slug":"invalid-value-for-column-column-in-table","errorCode":null,"errorMessage":"Invalid value for column \"' + column + '\" in table \"' + tableName + '\"","messagePattern":"Invalid value for column \"' \\+ column \\+ '\" in table \"' \\+ tableName \\+ '\"","errorType":"validation","errorClass":"DataTableValidationError","httpStatus":null,"severity":"error","filePath":"packages/data-table/src/lib/database/write-lifecycle.ts","lineNumber":414,"sourceCode":"    output[key] = (value as Record<string, unknown>)[key]\n  }\n\n  return output\n}\n\nfunction throwValidationIssues(\n  tableName: string,\n  issues: ReadonlyArray<ValidationIssue>,\n  operation: TableLifecycleOperation,\n  source?: LifecycleCallbackSource,\n): never {\n  let firstIssue = issues[0]\n  let issuePath = firstIssue?.path\n  let firstPathSegment = issuePath && issuePath.length > 0 ? issuePath[0] : undefined\n  let column = typeof firstPathSegment === 'string' ? firstPathSegment : undefined\n\n  if (column) {\n    throw new DataTableValidationError(\n      'Invalid value for column \"' + column + '\" in table \"' + tableName + '\"',\n      issues,\n      {\n        metadata: {\n          table: tableName,\n          column,\n          operation,\n          ...(source ? { source } : {}),\n        },\n      },\n    )\n  }\n\n  throw new DataTableValidationError('Invalid value for table \"' + tableName + '\"', issues, {\n    metadata: {\n      table: tableName,\n      operation,\n      ...(source ? { source } : {}),","sourceCodeStart":396,"sourceCodeEnd":432,"githubUrl":"https://github.com/remix-run/remix/blob/9696913134be3a4423513d2775f7b31d6917c049/packages/data-table/src/lib/database/write-lifecycle.ts#L396-L432","documentation":"When a validator or hook reports issues and the first issue's path starts with a string segment, the library throws a DataTableValidationError that names the offending column specifically. This is the column-level variant of validation failure: the value for that column failed a beforeWrite/validate/afterRead check.","triggerScenarios":"Returning { issues: [{ message: 'Invalid email', path: ['email'] }] } from a validator or beforeWrite hook; a read-time hook flagging a specific column of a loaded row.","commonSituations":"Standard field validation (bad email format, too-short password, out-of-range number); data drifting from constraints after an import; hooks enforcing invariants like 'status must be active'.","solutions":["Fix the underlying data so the column value passes validation","If the constraint is wrong, adjust the validator/hook issue condition","Surface the error's issues array to the user as form field errors"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":"function isColumnValidationError(error: unknown): error is DataTableValidationError {\n  return error instanceof DataTableValidationError && /Invalid value for column/.test(error.message)\n}","tryCatchPattern":"try {\n  await table.create({ values })\n} catch (error) {\n  if (error instanceof DataTableValidationError && error.metadata?.column) {\n    return json({ fieldErrors: { [error.metadata.column]: error.issues[0]?.message } }, { status: 400 })\n  }\n  throw error\n}","preventionTips":["Validate user input with the table validator before writes","Map error.issues (with path) onto form fields in your UI","Keep validator rules aligned with real data constraints"],"tags":["data-table","validation","column","hooks"],"backgroundTag":"column-validation-failed","analyzedSha":"9696913134be3a4423513d2775f7b31d6917c049","analyzedAt":"2026-08-27T19:55:01.024Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}