beekeeper-studio/beekeeper-studio · error
Column reordering is not supported in SurrealDB.
Error message
Column reordering is not supported in SurrealDB.
What it means
SurrealDB stores schemaless/schema-full records without positional column ordering, so reordering columns has no meaning in its data model. SurrealDBChangeBuilder.reorderColumns() unconditionally throws 'Column reordering is not supported in SurrealDB.'
Source
Thrown at apps/studio/src/shared/lib/sql/change_builder/SurrealDBChangeBuilder.ts:176
default:
return null;
}
}).filter(s => s !== null);
statements.push(...alterations);
}
if (statements.length === 0) {
return null;
}
const result = statements.join('; ');
return result.endsWith(';') ? result : `${result};`;
}
// Column reordering is not supported in SurrealDB
reorderColumns(): string {
throw new Error('Column reordering is not supported in SurrealDB.');
}
}View on GitHub (pinned to 4e3e03e322)
Solutions
- Do not call reorderColumns for SurrealDB; disable the reorder interaction when the dialect is surrealdb.
- Handle presentation-order concerns in the application layer rather than in DDL.
- Branch on dialect capability before issuing any column-order change.
Example fix
// before builder.reorderColumns() // after if (dialect !== 'surrealdb') builder.reorderColumns()
Defensive patterns
Strategy: validation
Validate before calling
if (dialect === 'surrealdb') {
// column order is meaningless in SurrealDB; skip DDL, order is presentation-only
return
}
builder.reorderColumns() Type guard
const supportsColumnReorder = (dialect: string) => dialect !== 'surrealdb'
Try / catch
try {
stmt = builder.reorderColumns()
} catch (e) {
if (e.message.includes('reordering')) {
saveColumnOrderAsUiPreferenceOnly() // no DDL for SurrealDB
} else throw e
} Prevention
- Disable drag-to-reorder for SurrealDB columns in the table designer.
- Treat column order as a UI preference, not a database attribute, for SurrealDB.
- Check dialect capability before generating order-dependent DDL.
- Note the limitation in docs for script/plugin authors.
When it happens
Trigger: Any call to reorderColumns() — e.g. drag-and-drop column reordering in a structured table editor applied to a SurrealDB table.
Common situations: Using a generic reorder-columns UI built for SQL databases against SurrealDB; SQL migration scripts containing ALTER TABLE ... column order adjustments; ORM features that assume column order.
Related errors
- SurrealDB does not support nullable/not null constraints. Us
- SurrealDB does not support column comments.
- can't add a field without name or data type
- SurrealDB does not support renaming fields directly. Create
- SurrealDB does not use traditional foreign key constraints.
AI-assisted analysis of beekeeper-studio/beekeeper-studio@4e3e03e322 (2026-08-31).
Data as JSON: /api/errors/24ffdf7e02f67161.
Report an issue: GitHub.