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

  1. Do not call reorderColumns for SurrealDB; disable the reorder interaction when the dialect is surrealdb.
  2. Handle presentation-order concerns in the application layer rather than in DDL.
  3. 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

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


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