Table Operations
TablePro provides a full suite of tools for creating, modifying, and managing database tables through a visual interface. Design new tables with a column editor, manage constraints and indexes, and perform common operations like drop, truncate, and duplicate — all without writing SQL by hand.
Create Table
Opening the Table Designer
To create a new table:
Open the Designer
Right-click in the sidebar and select Create New Table…, or press Cmd+Shift+N
Name Your Table
Enter a table name and verify the target database/schema
Add Columns
Define columns using the column editor or column templates
Set Constraints
Configure primary key, foreign keys, indexes, and check constraints
Review SQL
Expand the SQL Preview section to verify the generated DDL
Create
Click Create Table (or press Cmd+Return) to execute
Column Editor
The column editor displays all columns in a table-style layout. Each column shows its name, data type, and key properties at a glance.
Adding Columns
Add columns in two ways:
- Manual: Click the + button to add a blank column
- From Template: Click the Template menu to insert a pre-configured column
Available column templates:
| Template | Column Name | Type | Notes |
|---|
| ID (Auto Increment) | id | INT | NOT NULL, AUTO_INCREMENT |
| UUID | id | UUID / VARCHAR(36) | NOT NULL, database-specific |
| Name (VARCHAR) | name | VARCHAR(255) | NOT NULL, default '' |
| Email | email | VARCHAR(255) | NOT NULL |
| Description (TEXT) | description | TEXT | Nullable |
| Created At | created_at | TIMESTAMP | NOT NULL, default NOW() |
| Updated At | updated_at | TIMESTAMP | NOT NULL, default NOW() |
| Is Active (BOOLEAN) | is_active | BOOLEAN / TINYINT(1) | NOT NULL, default TRUE |
Column Detail Panel
Click any column to open the detail panel on the right side. The detail panel lets you configure every property of a column:
| Property | Description |
|---|
| Name | Column name |
| Data Type | Type with categorized picker (Numeric, String, Date/Time, Binary, Other) |
| Length | Character or display length (for VARCHAR, CHAR, etc.) |
| Precision | Decimal precision (for DECIMAL, NUMERIC) |
| Not Null | Whether NULL values are disallowed |
| Default | Default value expression |
| Auto Increment | Auto-incrementing integer (integer types only) |
| Unsigned | Unsigned number (MySQL/MariaDB only) |
| Comment | Column comment/description |
Press Escape to close the detail panel and return focus to the column list.
Reordering and Removing Columns
- Move up/down: Use the arrow buttons on each column row
- Delete: Click the delete button to remove a column
Data Types by Database
The type picker shows only the data types available for your connected database.
MySQL/MariaDB
PostgreSQL
SQLite
| Category | Types |
|---|
| Numeric | INT, BIGINT, SMALLINT, TINYINT, MEDIUMINT, DECIMAL, FLOAT, DOUBLE |
| String | VARCHAR, CHAR, TEXT, MEDIUMTEXT, LONGTEXT, TINYTEXT |
| Date/Time | DATE, TIME, DATETIME, TIMESTAMP, YEAR |
| Binary | BLOB, BINARY, VARBINARY |
| Other | BOOLEAN, JSON, ENUM, SET |
| Category | Types |
|---|
| Numeric | INT, BIGINT, SMALLINT, SERIAL, BIGSERIAL, DECIMAL, FLOAT, DOUBLE |
| String | VARCHAR, CHAR, TEXT |
| Date/Time | DATE, TIME, DATETIME, TIMESTAMP |
| Binary | BLOB, BINARY, VARBINARY |
| Other | BOOLEAN, JSON, JSONB, UUID |
| Category | Types |
|---|
| Numeric | INT, BIGINT, SMALLINT, DECIMAL, FLOAT, DOUBLE |
| String | VARCHAR, CHAR, TEXT |
| Date/Time | DATE, TIME, DATETIME, TIMESTAMP |
| Binary | BLOB, BINARY, VARBINARY |
| Other | BOOLEAN, JSON |
Constraints
Primary Key
Select one or more columns as the primary key using the checkboxes in the Primary Key section. A warning appears if no primary key is selected.
Tables without a primary key are not recommended. Always define a primary key for data integrity and query performance.
Foreign Keys
Add foreign key constraints that reference other tables:
| Property | Description |
|---|
| Name | Constraint name (auto-generated if left empty) |
| Columns | Local column(s) |
| Referenced Table | Target table |
| Referenced Columns | Target column(s) |
| On Delete | NO ACTION, CASCADE, SET NULL, SET DEFAULT, RESTRICT |
| On Update | NO ACTION, CASCADE, SET NULL, SET DEFAULT, RESTRICT |
Indexes
Create indexes during table creation:
| Property | Description |
|---|
| Name | Index name |
| Columns | Columns included in the index |
| Unique | Whether the index enforces uniqueness |
| Type | BTREE, HASH, GIST (PostgreSQL), GIN (PostgreSQL) |
Check Constraints
Available for PostgreSQL and SQLite. Define named check constraints with SQL expressions:
| Property | Description |
|---|
| Name | Constraint name |
| Expression | SQL expression (e.g., age >= 0) |
Advanced Options
Expand the Advanced Options section to configure database-specific settings:
MySQL/MariaDB
PostgreSQL
SQLite
| Option | Default | Description |
|---|
| Engine | InnoDB | Storage engine |
| Charset | utf8mb4 | Character set |
| Collation | utf8mb4_unicode_ci | Collation |
| Comment | — | Table comment |
| Option | Default | Description |
|---|
| Tablespace | — | PostgreSQL tablespace |
| Comment | — | Table comment |
| Option | Default | Description |
|---|
| Comment | — | Table comment |
SQL Preview
Expand the SQL Preview section to see the exact CREATE TABLE statement that will be executed. You can copy it to the clipboard using the copy button.
Import DDL
Already have a CREATE TABLE statement? Click the Import button in the toolbar to paste existing DDL. TablePro parses the statement and populates the column editor automatically.
Click Import
Click the Import button (square-and-arrow-up icon) in the table designer toolbar
Paste DDL
Paste your CREATE TABLE statement into the text editor
Import
Click Import to parse and populate the designer
Duplicate from Existing Table
Copy the structure of an existing table into the designer:
- Click the Duplicate button in the toolbar
- Select a table from the list of existing tables
- Click Duplicate to load its columns and primary keys
- The new table name defaults to
original_name_copy
Duplicating a table copies its column definitions and primary key. Foreign keys, indexes, and advanced options are not copied automatically.
Table Templates
Save frequently used table structures as templates for quick reuse.
Saving a Template
- Design your table with columns, types, and constraints
- Click the Save button (square-and-arrow-down icon) in the toolbar
- Enter a template name
- Click Save
Templates are stored in ~/Library/Application Support/TablePro/table_templates.json.
Loading a Template
- Click the Load button (folder icon) in the toolbar
- Select a template from the list
- Click Load to populate the designer
Loading a template preserves your current table name and database. Only column definitions and constraints are replaced.
Managing Templates
- Delete: Click the trash icon next to a template in the Load dialog
- Templates persist across sessions and connections
Table Operations
Right-click a table in the sidebar to access these operations.
Drop Table
Permanently deletes a table and all its data.
- Right-click the table (or select multiple tables)
- Select Delete
- Configure options in the confirmation dialog
- Click OK to execute
Options by database:
MySQL/MariaDB
PostgreSQL
SQLite
| Option | Description |
|---|
| Ignore foreign key checks | Temporarily disables foreign key validation |
| Cascade | Not supported |
| Option | Description |
|---|
| Ignore foreign key checks | Not supported (use CASCADE instead) |
| Cascade | Drop all dependent objects (views, foreign keys) |
| Option | Description |
|---|
| Ignore foreign key checks | Temporarily disables foreign key validation |
| Cascade | Not supported |
Dropping a table is irreversible. Always backup important data before dropping tables.
Truncate Table
Removes all rows from a table while keeping the table structure.
- Right-click the table (or select multiple tables)
- Select Truncate
- Configure options in the confirmation dialog
- Click OK to execute
Options by database:
MySQL/MariaDB
PostgreSQL
SQLite
| Option | Description |
|---|
| Ignore foreign key checks | Temporarily disables foreign key validation |
| Cascade | Not supported for TRUNCATE |
| Option | Description |
|---|
| Ignore foreign key checks | Not supported (use CASCADE instead) |
| Cascade | Truncate all tables linked by foreign keys |
| Option | Description |
|---|
| Ignore foreign key checks | Temporarily disables foreign key validation |
| Cascade | Not supported |
Truncate is faster than DELETE FROM table because it does not generate individual row delete logs. However, it resets auto-increment counters.
Batch Operations
You can select multiple tables in the sidebar and apply Drop or Truncate to all of them at once. The same options are applied to every selected table.
- Hold
Cmd and click to select multiple tables
- Right-click and choose Delete or Truncate
- Configure options once in the dialog
- All selected tables are processed
View Management
Database views are virtual tables defined by SQL queries. TablePro displays views in the sidebar with a distinctive eye icon and purple color.
Create View
Create a new view by opening a SQL editor tab with a template:
- Right-click in the sidebar and select Create New View…
- Or go to File > New View…
- A new SQL editor tab opens with a CREATE VIEW template
- Modify the view name and SELECT query
- Execute the query to create the view
The template adapts to your database type:
MySQL/MariaDB
PostgreSQL
SQLite
CREATE VIEW view_name AS
SELECT column1, column2
FROM table_name
WHERE condition;
CREATE OR REPLACE VIEW view_name AS
SELECT column1, column2
FROM table_name
WHERE condition;
CREATE VIEW IF NOT EXISTS view_name AS
SELECT column1, column2
FROM table_name
WHERE condition;
Edit View Definition
Modify an existing view’s SQL definition:
- Right-click the view in the sidebar
- Select Edit View Definition
- The current view definition is fetched and opened in a new SQL editor tab
- Modify the query and execute to update the view
For MySQL/MariaDB, you can use ALTER VIEW to modify a view. For PostgreSQL, use CREATE OR REPLACE VIEW. SQLite does not support ALTER VIEW — you must drop and recreate the view.
Drop View
Remove a view from the database:
- Right-click the view in the sidebar
- Select Drop View
- Confirm the deletion
Views don’t store data themselves, so dropping a view only removes the view definition — the underlying table data remains intact.
The sidebar context menu adapts when you right-click a view:
| Action | Tables | Views |
|---|
| Show Structure | Yes | Yes |
| Export | Yes | Yes |
| Import | Yes | No |
| Truncate | Yes | No |
| Edit Definition | No | Yes |
| Delete / Drop | Yes | Yes |
Database Operations
Create Database
Create a new database directly from the UI (MySQL/MariaDB):
Open Database Switcher
Click the database name in the toolbar or press Cmd+K to open the database switcher
Click Create
Click the Create button in the database switcher toolbar
Configure
Enter a name, select character set and collation
Create
Click Create to execute
Available character sets and collations:
| Charset | Collations |
|---|
| utf8mb4 | utf8mb4_unicode_ci, utf8mb4_general_ci, utf8mb4_bin |
| utf8 | utf8_unicode_ci, utf8_general_ci, utf8_bin |
| latin1 | latin1_swedish_ci, latin1_general_ci, latin1_bin |
| ascii | ascii_general_ci, ascii_bin |
Database Switcher
Quickly switch between databases on the same connection:
- Click the database name in the toolbar
- Browse the list of available databases with metadata
- Search by name to filter
- Double-click or select and click Open to switch
The database switcher shows recent databases for quick access and supports refreshing the database list.
Keyboard Shortcuts
| Action | Shortcut |
|---|
| Create new table | Cmd+Shift+N |
| Confirm create table | Cmd+Return |
| Delete selected table(s) | Cmd+Delete |
| Copy table name | Cmd+C (in sidebar) |
| Export table | Cmd+E (in sidebar) |
| Import data | Cmd+I (in sidebar) |
Next Steps