Table Structure Editor
Edit table columns and indexes visually, then preview DDL before applying changes.
The table structure editor modifies columns, indexes, and constraints for a single table. Use it for focused structure changes or to generate reviewable DDL without writing it by hand.
The structure editor is enabled for MySQL, PostgreSQL, SQLite, SQL Server, and ClickHouse. Other databases may still expose DDL through the schema browser, but DBX does not show the visual editor when it cannot generate safe changes.
What You Can Edit
| Object | Supported Actions |
|---|---|
| Columns | Add, delete, rename, and modify columns; change type, length, default, nullable, and comments |
| Primary Key | Add, modify, or remove primary key columns |
| Indexes | Add, delete, and rebuild indexes; configure index type, included columns, WHERE filter, and comments |
| Comments | MySQL/PostgreSQL can write column and index comments |
| Column Order | Reorder columns visually; DBX generates the appropriate ALTER statements |
Editor Interface
The table structure editor opens as a persistent tab, not a modal dialog:
- Type + Length columns: Data type and length/precision are split into separate columns with searchable select dropdowns
- Resizable columns: Drag column borders to adjust the editor layout
- Syntax highlighting: SQL preview uses Shiki syntax highlighting
- DDL capability matrix: The editor knows which DDL operations each database supports and only enables relevant controls
Database engines differ in DDL capabilities. DBX generates SQL for the active connection type.
Workflow
Open Table Structure
Right-click a table in the sidebar and open its structure view.
Edit Columns or Indexes
Add, modify, or remove columns and indexes in the visual editor. Changes are staged locally first.
Review SQL Preview
Before saving, review generated statements such as ALTER TABLE, CREATE INDEX, and DROP INDEX.
Apply Changes
Execute the SQL only after confirming it matches your intent.
Dropping columns, changing column types, and changing nullable constraints can affect existing data. Back up production databases first and confirm application code does not depend on the old structure.
Engine Differences
| Engine | Notes |
|---|---|
| MySQL / MariaDB | Add, delete, and modify columns; add and delete indexes |
| PostgreSQL | Rename columns, change type/default/nullability/comments, and add/delete indexes |
| SQLite | Add, delete, and rename columns; more complex existing-column edits are blocked with a warning |
| SQL Server | Focused editor support for common table structure operations |
| Other engines | Use generated DDL, Schema Diff, or manual SQL when DBX does not expose the visual editor |
Recommendations
- Use the editor for small, focused changes
- For large migrations, generate SQL and review it in your code repository
- For environment sync, use Schema Diff
- When impact is uncertain, back up first with Database Export