Table Structure
Browse columns, indexes, foreign keys, triggers, and DDL for any table. Edit structure visually or with SQL.

Table structure view
Columns Tab


Column definitions
Use the filter field at the top to search columns by name. Click any column header to sort.
Indexes Tab


Table indexes
Add and Drop Indexes
Click + to add a new index, - orDelete to mark an index for removal. Multi-column indexes are supported by adding multiple column entries to one index row.
- Partial indexes (PostgreSQL): enter a
WHEREpredicate in the Condition field. The generated DDL emitsCREATE INDEX ... WHERE .... - Prefix length (MySQL/MariaDB): append
(N)to the column entry, for exampleemail(20). Useful forTEXTand longVARCHARcolumns. - Index type: pick from the type dropdown. Available types depend on the database (BTREE everywhere, GIN/GIST/BRIN on PostgreSQL, FULLTEXT/SPATIAL on MySQL).
CREATE INDEX / DROP INDEX statements before executing.
Foreign Keys Tab


Foreign key relationships
On Delete and On Update use dropdown pickers with all standard referential actions.
Add and Drop Foreign Keys
Click + to add a new foreign key, - orDelete to remove one. The local and referenced columns use dropdowns populated from the live schema, so typos surface as missing entries rather than runtime errors.
- Cross-schema references: pick a different schema in the Ref Schema column for PostgreSQL or MySQL. The generated DDL qualifies the referenced table (
other_schema.other_table). - Composite foreign keys: add multiple column pairs to a single FK entry.
- Referential actions: configure
ON DELETEandON UPDATEper FK.
ALTER TABLE ... ADD CONSTRAINT / DROP CONSTRAINT SQL.
Primary Keys
Mark one or more columns as primary key in the Columns tab by toggling the Primary Key flag. Multiple flagged columns produce a composite primary key. The generated DDL emits a singlePRIMARY KEY (col1, col2) clause.
Changing a primary key on an existing table executes as a drop-and-add sequence. SQLite and ClickHouse do not support modifying primary keys without recreating the table: TablePro disables the action on those databases.
Table Options (MySQL/MariaDB)
The Columns tab toolbar exposes table-level Charset and Collation pickers for MySQL and MariaDB. Changes generateALTER TABLE ... CONVERT TO CHARACTER SET ... and update the table’s default collation. Per-column overrides remain available in the column detail panel.
DDL Tab


DDL (CREATE TABLE) statement
- Copy the DDL to clipboard
- Export as a
.sqlfile - Open in Editor to send the DDL to a new query tab for editing
Triggers Tab
The Triggers tab lists the table’s triggers and shows the full definition of the selected one. Use the filter field to narrow the list, and click a column header to sort.
Select a trigger to see its full definition in a syntax-highlighted viewer with Copy and Open in Editor buttons. The definition is the
CREATE TRIGGER statement, which includes the orientation (FOR EACH ROW/STATEMENT) and any WHEN condition. MySQL and MariaDB reconstruct it from the body; PostgreSQL uses pg_get_triggerdef; SQLite, libSQL, and Cloudflare D1 read the stored statement; SQL Server uses OBJECT_DEFINITION.
Editing Triggers
Use New Trigger, Edit, and Delete in the Triggers tab toolbar to manage triggers. The editor opens the trigger’s actual DDL so the whole definition round-trips without losing any clause. For PostgreSQL it shows both the trigger function and the trigger so you can edit the logic. Saving runs the correct statements for the engine (CREATE OR REPLACE / CREATE OR ALTER, or drop-and-recreate), wrapped in a transaction where the engine supports transactional DDL, and goes through the same confirmation and safe-mode checks as other schema changes. Oracle creates and drops triggers, but its body is not retrieved, so editing starts from the trigger header.
Available for MySQL, MariaDB, PostgreSQL, SQLite, SQL Server, Oracle, libSQL, and Cloudflare D1. The tab is hidden for databases that do not expose triggers. Oracle shows trigger metadata only; the body is not retrieved.
Creating a New Table
Right-click in the sidebar and select Create New Table…. A visual editor opens with:- Table Name field and database-specific options (Engine, Charset, Collation for MySQL/MariaDB)
- Columns tab - define columns with name, type, nullable, default, primary key, auto increment, and comment
- Indexes tab - add indexes with type (BTREE, HASH, FULLTEXT, SPATIAL) and uniqueness
- Foreign Keys tab - define relationships with referenced tables, ON DELETE/ON UPDATE actions
- SQL Preview tab - live-generated CREATE TABLE DDL with syntax highlighting
Cmd+S or Cmd+Return) to execute. The tab becomes the new table’s data view and the table appears in the sidebar immediately.
Supported databases: MySQL, MariaDB, PostgreSQL, SQLite, SQL Server, ClickHouse, and DuckDB. Each generates database-specific DDL syntax.
Modifying Structure
Database Support
Not all databases support every ALTER TABLE operation. TablePro disables unsupported actions in the UI.
Cassandra supports add and drop column only. MongoDB structure is read-only. Redis, Etcd, and DynamoDB do not have table schemas.
Visual Structure Editor
Adding Columns
- Open Structure > Columns, click +
- Set properties: name, type, nullable, default, auto-increment, comment
- Click the Type cell to open the type picker. Browse by category or search. For parametric types (
VARCHAR(255),DECIMAL(10,2)), type directly in the freeform field. - Click Apply to preview and execute


Adding a column
Modifying Columns
Click a column, edit properties in the detail panel, then Apply to preview the ALTER TABLE SQL. Changes support undo/redo.Removing Columns
Select the column, click - or press Delete, confirm, then apply.

Type picker popover
Context Menu
Right-click any row in the Columns, Indexes, or Foreign Keys tabs:
Multi-select rows to copy or delete multiple items at once.
Schema Change Preview
Before applying, TablePro shows the generated ALTER TABLE SQL for review.

Schema change preview
Cmd+Z to undo, Cmd+Shift+Z to redo structure changes before applying. Schema changes are recorded in query history.


Undo and redo for structure changes
Reordering Columns
Drag a column row up or down in the Columns tab to change its position. The reorder executes immediately as anALTER TABLE ... MODIFY COLUMN ... AFTER statement.
Column reordering is only available for MySQL and MariaDB. Other databases do not support changing column order without recreating the table.
Refreshing Structure
Right-click the table > Refresh, or use View > Refresh. Changes made in TablePro refresh automatically.MongoDB Collections
The structure tab for MongoDB is read-only. TablePro infers the schema by sampling documents. Three columns are shown:- Name: Field name (including nested paths with dot notation)
- Type: BSON type (ObjectId, String, Int32, Int64, Double, Boolean, Date, Array, Object, etc.)
- Nullable: Whether the field is present in all sampled documents
Indexes
MongoDB indexes are shown ascreateIndex() commands that can be copied and run in mongosh.
DDL Tab
Shows index definitions asdb.collection.createIndex() statements, collection validators as db.runCommand({collMod: ...}), and collection options (capped, size, max) if applicable.
MongoDB is schema-less, so structure modification is not available. Edit documents directly in the data grid.
