{"record":{"id":"0a3a1b0d1171db02","repo":"beekeeper-studio/beekeeper-studio","slug":"dynamodb-is-schemaless","errorCode":null,"errorMessage":"DynamoDB is schemaless","messagePattern":"DynamoDB is schemaless","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"apps/studio/src/shared/lib/sql/change_builder/DynamoDBChangeBuilder.ts","lineNumber":31,"sourceCode":"\n  wrapLiteral(value: string): string {\n    return value;\n  }\n\n  escapeString(value: string): string {\n    return value;\n  }\n\n  alterType(_column: string, _newType: string): string {\n    throw new Error(\"DynamoDB does not support altering attribute types\");\n  }\n\n  alterDefault(_column: string, _newDefault: string | null): string {\n    throw new Error(\"DynamoDB does not support default values\");\n  }\n\n  alterNullable(_column: string, _nullable: boolean): string {\n    throw new Error(\"DynamoDB is schemaless\");\n  }\n\n  addColumn(_item: SchemaItem): string {\n    throw new Error(\"DynamoDB is schemaless; attributes are added per-item\");\n  }\n\n  dropColumn(_column: string): string {\n    throw new Error(\"DynamoDB is schemaless; attributes are removed per-item\");\n  }\n}\n","sourceCodeStart":13,"sourceCodeEnd":42,"githubUrl":"https://github.com/beekeeper-studio/beekeeper-studio/blob/4e3e03e3223b2b71a1af8926d455f533b80af837/apps/studio/src/shared/lib/sql/change_builder/DynamoDBChangeBuilder.ts#L13-L42","documentation":"DynamoDBChangeBuilder.alterNullable always throws because nullability is a schema concept and DynamoDB tables declare no attribute schema. Whether an attribute exists or is absent is per-item, so there is nothing to alter.","triggerScenarios":"Calling alterNullable(column, nullable) on the DynamoDB change builder from any generic column-constraint editing flow.","commonSituations":"Toggling NOT NULL / nullable in the table-structure editor on a DynamoDB connection; ORM-style migrations applying nullability changes to every dialect.","solutions":["Do not attempt to alter nullability for DynamoDB; model optional attributes by simply omitting them per item","Filter out nullability changes when the target dialect is DynamoDB","Catch the error and show a schemaless-dialect message"],"exampleFix":"// before\nbuilder.alterNullable('middleName', true) // throws\n// after\n// just omit the attribute on items that don't have it\nconst item = { ...(middleName ? { middleName } : {}) }","handlingStrategy":"try-catch","validationCode":"if (dialect === 'dynamodb') { throw new UnsupportedOperation('DynamoDB is schemaless; nullability is not applicable'); }\nbuilder.alterNullable(column, nullable);","typeGuard":"function supportsAlterNullable(b): b is Exclude<typeof b, DynamoDBChangeBuilder> {\n  return !(b instanceof DynamoDBChangeBuilder);\n}","tryCatchPattern":"try {\n  return builder.alterNullable(column, nullable);\n} catch (e) {\n  if (e.message.includes('is schemaless')) {\n    return null; // omit attribute per item instead\n  }\n  throw e;\n}","preventionTips":["Model optional attributes by omitting them from items","Filter nullability changes out for schemaless dialects","Hide NOT NULL toggles in the UI for DynamoDB connections","Check dialect capabilities before generating alter scripts"],"tags":["unsupported-operation","dynamodb","schema","nosql"],"backgroundTag":"operation-not-supported","analyzedSha":"4e3e03e3223b2b71a1af8926d455f533b80af837","analyzedAt":"2026-08-31T23:21:23.379Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}