Skip to main content

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

Create Table

Opening the Table Designer

To create a new table:
1

Open the Designer

Right-click in the sidebar and select Create New Table…, or press Cmd+Shift+N
2

Name Your Table

Enter a table name and verify the target database/schema
3

Add Columns

Define columns using the column editor or column templates
4

Set Constraints

Configure primary key, foreign keys, indexes, and check constraints
5

Review SQL

Expand the SQL Preview section to verify the generated DDL
6

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.
Column editor

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:
TemplateColumn NameTypeNotes
ID (Auto Increment)idINTNOT NULL, AUTO_INCREMENT
UUIDidUUID / VARCHAR(36)NOT NULL, database-specific
Name (VARCHAR)nameVARCHAR(255)NOT NULL, default ''
EmailemailVARCHAR(255)NOT NULL
Description (TEXT)descriptionTEXTNullable
Created Atcreated_atTIMESTAMPNOT NULL, default NOW()
Updated Atupdated_atTIMESTAMPNOT NULL, default NOW()
Is Active (BOOLEAN)is_activeBOOLEAN / 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:
PropertyDescription
NameColumn name
Data TypeType with categorized picker (Numeric, String, Date/Time, Binary, Other)
LengthCharacter or display length (for VARCHAR, CHAR, etc.)
PrecisionDecimal precision (for DECIMAL, NUMERIC)
Not NullWhether NULL values are disallowed
DefaultDefault value expression
Auto IncrementAuto-incrementing integer (integer types only)
UnsignedUnsigned number (MySQL/MariaDB only)
CommentColumn 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.
CategoryTypes
NumericINT, BIGINT, SMALLINT, TINYINT, MEDIUMINT, DECIMAL, FLOAT, DOUBLE
StringVARCHAR, CHAR, TEXT, MEDIUMTEXT, LONGTEXT, TINYTEXT
Date/TimeDATE, TIME, DATETIME, TIMESTAMP, YEAR
BinaryBLOB, BINARY, VARBINARY
OtherBOOLEAN, JSON, ENUM, SET

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:
PropertyDescription
NameConstraint name (auto-generated if left empty)
ColumnsLocal column(s)
Referenced TableTarget table
Referenced ColumnsTarget column(s)
On DeleteNO ACTION, CASCADE, SET NULL, SET DEFAULT, RESTRICT
On UpdateNO ACTION, CASCADE, SET NULL, SET DEFAULT, RESTRICT

Indexes

Create indexes during table creation:
PropertyDescription
NameIndex name
ColumnsColumns included in the index
UniqueWhether the index enforces uniqueness
TypeBTREE, HASH, GIST (PostgreSQL), GIN (PostgreSQL)

Check Constraints

Available for PostgreSQL and SQLite. Define named check constraints with SQL expressions:
PropertyDescription
NameConstraint name
ExpressionSQL expression (e.g., age >= 0)

Advanced Options

Expand the Advanced Options section to configure database-specific settings:
OptionDefaultDescription
EngineInnoDBStorage engine
Charsetutf8mb4Character set
Collationutf8mb4_unicode_ciCollation
CommentTable 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.
SQL Preview

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.
1

Click Import

Click the Import button (square-and-arrow-up icon) in the table designer toolbar
2

Paste DDL

Paste your CREATE TABLE statement into the text editor
3

Import

Click Import to parse and populate the designer

Duplicate from Existing Table

Copy the structure of an existing table into the designer:
  1. Click the Duplicate button in the toolbar
  2. Select a table from the list of existing tables
  3. Click Duplicate to load its columns and primary keys
  4. 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

  1. Design your table with columns, types, and constraints
  2. Click the Save button (square-and-arrow-down icon) in the toolbar
  3. Enter a template name
  4. Click Save
Templates are stored in ~/Library/Application Support/TablePro/table_templates.json.

Loading a Template

  1. Click the Load button (folder icon) in the toolbar
  2. Select a template from the list
  3. 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.
  1. Right-click the table (or select multiple tables)
  2. Select Delete
  3. Configure options in the confirmation dialog
  4. Click OK to execute
Drop table dialog
Options by database:
OptionDescription
Ignore foreign key checksTemporarily disables foreign key validation
CascadeNot 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.
  1. Right-click the table (or select multiple tables)
  2. Select Truncate
  3. Configure options in the confirmation dialog
  4. Click OK to execute
Options by database:
OptionDescription
Ignore foreign key checksTemporarily disables foreign key validation
CascadeNot supported for TRUNCATE
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.
  1. Hold Cmd and click to select multiple tables
  2. Right-click and choose Delete or Truncate
  3. Configure options once in the dialog
  4. 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:
  1. Right-click in the sidebar and select Create New View…
  2. Or go to File > New View…
  3. A new SQL editor tab opens with a CREATE VIEW template
  4. Modify the view name and SELECT query
  5. Execute the query to create the view
The template adapts to your database type:
CREATE VIEW view_name AS
SELECT column1, column2
FROM table_name
WHERE condition;

Edit View Definition

Modify an existing view’s SQL definition:
  1. Right-click the view in the sidebar
  2. Select Edit View Definition
  3. The current view definition is fetched and opened in a new SQL editor tab
  4. 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:
  1. Right-click the view in the sidebar
  2. Select Drop View
  3. Confirm the deletion
Views don’t store data themselves, so dropping a view only removes the view definition — the underlying table data remains intact.

Context Menu Differences

The sidebar context menu adapts when you right-click a view:
ActionTablesViews
Show StructureYesYes
ExportYesYes
ImportYesNo
TruncateYesNo
Edit DefinitionNoYes
Delete / DropYesYes

Database Operations

Create Database

Create a new database directly from the UI (MySQL/MariaDB):
1

Open Database Switcher

Click the database name in the toolbar or press Cmd+K to open the database switcher
2

Click Create

Click the Create button in the database switcher toolbar
3

Configure

Enter a name, select character set and collation
4

Create

Click Create to execute
Create Database
Available character sets and collations:
CharsetCollations
utf8mb4utf8mb4_unicode_ci, utf8mb4_general_ci, utf8mb4_bin
utf8utf8_unicode_ci, utf8_general_ci, utf8_bin
latin1latin1_swedish_ci, latin1_general_ci, latin1_bin
asciiascii_general_ci, ascii_bin

Database Switcher

Quickly switch between databases on the same connection:
  1. Click the database name in the toolbar
  2. Browse the list of available databases with metadata
  3. Search by name to filter
  4. 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

ActionShortcut
Create new tableCmd+Shift+N
Confirm create tableCmd+Return
Delete selected table(s)Cmd+Delete
Copy table nameCmd+C (in sidebar)
Export tableCmd+E (in sidebar)
Import dataCmd+I (in sidebar)

Next Steps