beekeeper-studio/beekeeper-studio · error

DynamoDB is schemaless

Error message

DynamoDB is schemaless

What it means

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.

Source

Thrown at apps/studio/src/shared/lib/sql/change_builder/DynamoDBChangeBuilder.ts:31

  wrapLiteral(value: string): string {
    return value;
  }

  escapeString(value: string): string {
    return value;
  }

  alterType(_column: string, _newType: string): string {
    throw new Error("DynamoDB does not support altering attribute types");
  }

  alterDefault(_column: string, _newDefault: string | null): string {
    throw new Error("DynamoDB does not support default values");
  }

  alterNullable(_column: string, _nullable: boolean): string {
    throw new Error("DynamoDB is schemaless");
  }

  addColumn(_item: SchemaItem): string {
    throw new Error("DynamoDB is schemaless; attributes are added per-item");
  }

  dropColumn(_column: string): string {
    throw new Error("DynamoDB is schemaless; attributes are removed per-item");
  }
}

View on GitHub (pinned to 4e3e03e322)

Solutions

  1. Do not attempt to alter nullability for DynamoDB; model optional attributes by simply omitting them per item
  2. Filter out nullability changes when the target dialect is DynamoDB
  3. Catch the error and show a schemaless-dialect message

Example fix

// before
builder.alterNullable('middleName', true) // throws
// after
// just omit the attribute on items that don't have it
const item = { ...(middleName ? { middleName } : {}) }
Defensive patterns

Strategy: try-catch

Validate before calling

if (dialect === 'dynamodb') { throw new UnsupportedOperation('DynamoDB is schemaless; nullability is not applicable'); }
builder.alterNullable(column, nullable);

Type guard

function supportsAlterNullable(b): b is Exclude<typeof b, DynamoDBChangeBuilder> {
  return !(b instanceof DynamoDBChangeBuilder);
}

Try / catch

try {
  return builder.alterNullable(column, nullable);
} catch (e) {
  if (e.message.includes('is schemaless')) {
    return null; // omit attribute per item instead
  }
  throw e;
}

Prevention

When it happens

Trigger: Calling alterNullable(column, nullable) on the DynamoDB change builder from any generic column-constraint editing flow.

Common situations: Toggling NOT NULL / nullable in the table-structure editor on a DynamoDB connection; ORM-style migrations applying nullability changes to every dialect.

Related errors


AI-assisted analysis of beekeeper-studio/beekeeper-studio@4e3e03e322 (2026-08-31). Data as JSON: /api/errors/0a3a1b0d1171db02. Report an issue: GitHub.