{"record":{"id":"abfb7139fa003e13","repo":"beekeeper-studio/beekeeper-studio","slug":"dynamodb-does-not-support-creating-databases","errorCode":null,"errorMessage":"DynamoDB does not support creating databases","messagePattern":"DynamoDB does not support creating databases","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"info","filePath":"apps/studio/src-commercial/backend/lib/db/clients/dynamodb.ts","lineNumber":867,"sourceCode":"    }\n\n    // Each UpdateTable call can only process one GSI change, so iterate.\n    for (const update of updates) {\n      await this.raw.send(new UpdateTableCommand({\n        TableName: changes.table,\n        AttributeDefinitions: Array.from(existingAttrs.values()),\n        GlobalSecondaryIndexUpdates: [update],\n      }));\n    }\n  }\n\n  // -------------------- unsupported operations ---------------------\n  getBuilder(table: string, schema?: string): ChangeBuilderBase {\n    return new DynamoDBChangeBuilder(table, schema);\n  }\n\n  async createDatabase(): Promise<string> {\n    throw new Error('DynamoDB does not support creating databases');\n  }\n\n  async createDatabaseSQL(): Promise<string> {\n    throw new Error('DynamoDB does not support generating SQL');\n  }\n\n  async getTableCreateScript(): Promise<string> {\n    throw new Error('DynamoDB does not expose CREATE TABLE SQL');\n  }\n\n  async getViewCreateScript(): Promise<string[]> {\n    throw new Error('DynamoDB does not support views');\n  }\n\n  async getMaterializedViewCreateScript(): Promise<string[]> {\n    throw new Error('DynamoDB does not support materialized views');\n  }\n","sourceCodeStart":849,"sourceCodeEnd":885,"githubUrl":"https://github.com/beekeeper-studio/beekeeper-studio/blob/4e3e03e3223b2b71a1af8926d455f533b80af837/apps/studio/src-commercial/backend/lib/db/clients/dynamodb.ts#L849-L885","documentation":"DynamoDBClient.createDatabase() is a stub that always throws. DynamoDB is a managed NoSQL service with no concept of user-created database/catalog objects, so the operation is unsupported by design. Any UI or script path that triggers database creation against a DynamoDB connection hits this error.","triggerScenarios":"Calling DynamoDBClient.createDatabase(), or using Beekeeper Studio's 'Create Database' action while connected to a DynamoDB data source.","commonSituations":"User right-clicks the connection in the sidebar and picks 'Create Database'; automation scripts reusing a generic DB client interface across connection types.","solutions":["Do not create databases on DynamoDB — create tables (or use separate AWS accounts/regions for logical separation) instead","Guard the UI action: hide 'Create Database' for dynamodb connection types","Catch the error and surface a clear 'unsupported for DynamoDB' message"],"exampleFix":"// before\nawait client.createDatabase('mydb');\n// after\nif (client.connectionType === 'dynamodb') {\n  throw new UnsupportedOperationNotice('DynamoDB: create tables instead of databases');\n}\nawait client.createDatabase('mydb');","handlingStrategy":"validation","validationCode":"const SUPPORTS_CREATE_DB = !['dynamodb'].includes(connectionType);\nif (!SUPPORTS_CREATE_DB) throw new SkipAction('create-database unsupported for ' + connectionType);","typeGuard":"function isDynamoDBClient(c: any): c is DynamoDBClient {\n  return c?.connectionType === 'dynamodb' || c instanceof DynamoDBClient;\n}","tryCatchPattern":"try {\n  await client.createDatabase(name);\n} catch (e) {\n  if (String(e.message).includes('DynamoDB does not support')) {\n    notifyUser('DynamoDB has no database concept; create tables instead.');\n    return;\n  }\n  throw e;\n}","preventionTips":["Hide database-level DDL actions for NoSQL connection types","Maintain a per-client capability map and drive the UI from it","Check connection type before calling any interface method with known NoSQL gaps"],"tags":["dynamodb","nosql","unsupported-operation","create-database"],"backgroundTag":"unsupported-dynamodb-operation","analyzedSha":"4e3e03e3223b2b71a1af8926d455f533b80af837","analyzedAt":"2026-08-31T23:21:23.379Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}