The Canvas
The schema canvas is an infinite, pannable workspace where your tables are displayed as interactive nodes. You can freely arrange tables to create a clear visual representation of your database structure.
| Action | How |
|---|---|
| Pan | Click and drag on empty canvas space |
| Zoom | Scroll wheel or pinch gesture on trackpad |
| Fit to view | The canvas automatically fits all tables into view when you first open a project |
| Select a table | Click on a table node to select it and open its property panel |
Right-click context menu
Creating Tables
To create a new table, click the Add Table button in the floating toolbar at the top of the canvas. A new table node will appear at the center of your current viewport.
Each table starts with a default name (e.g., "new_table") that you should rename immediately. Click on the table name in the property panel to edit it.
Good naming conventions for tables:
- Use snake_case (e.g.,
user_profiles) - Use plural names for collections (e.g.,
ordersnotorder) - Be descriptive but concise
You can also add an optional comment to the table to describe its purpose. This comment is included in exported migrations.
Adding Columns
Select a table to open its property panel, then click Add Column to add a new column. Each column has the following properties:
| Property | Description |
|---|---|
| Name | Column name (use snake_case, e.g., created_at) |
| Data Type | Database-specific type (e.g., VARCHAR, INTEGER, TIMESTAMP for PostgreSQL) |
| Primary Key | Mark as the table's primary identifier |
| Nullable | Whether the column allows NULL values |
| Unique | Enforce unique values across all rows |
| Default Value | A default value when no value is provided on insert |
Note
Relationships
Relationships define how tables connect to each other. PicaDeck supports three relationship types:
One-to-One (1:1)
Each row in Table A is linked to exactly one row in Table B, and vice versa. Example: a users table and a user_profiles table.
One-to-Many (1:N)
One row in Table A can be linked to many rows in Table B. This is the most common relationship type. Example: one user has many orders.
Many-to-Many (M:N)
Rows in Table A can link to many rows in Table B and vice versa. This typically requires a junction/pivot table. Example: students and courses.
To create a relationship, use the Add Relationship button in the toolbar, then select the source and target tables and columns. You can also configure:
- ON DELETE — what happens when the referenced row is deleted (CASCADE, SET NULL, RESTRICT, NO ACTION)
- ON UPDATE — what happens when the referenced key is updated
Relationships are displayed as lines connecting tables on the canvas. The line style indicates the relationship type — a solid dot for the "one" side and a fork for the "many" side.
Categories
Categories let you organize tables into color-coded groups for better visual clarity. This is especially useful in large schemas with dozens of tables.
For example, you might create categories like:
- Auth — User, Session, Account tables
- Commerce — Product, Order, Invoice tables
- Content — Post, Comment, Tag tables
To manage categories, open the category manager from the sidebar. You can create new categories with custom names and colors, then assign tables to them from the property panel.
Custom Types
PicaDeck supports two kinds of custom types that you can define and reuse across your schema:
Enums
A list of allowed string values. Useful for status fields, roles, or any column with a fixed set of options. Example: an OrderStatus enum with values PENDING, SHIPPED, DELIVERED.
Composite Types
A structured type with named fields. Useful for grouping related fields into a single reusable type. Example: an Address type with fields like street, city, country, zip_code.
Once created, custom types appear in the data type dropdown when adding or editing columns. They are also included in migration exports.
Auto Layout
Click the Auto Layout button in the toolbar to automatically arrange all tables on the canvas. The algorithm positions tables to minimize relationship line crossings and create a clean, readable layout.
After auto-layout, you can still manually drag individual tables to fine-tune their positions. All positions are saved automatically.
Undo & Redo
PicaDeck tracks all schema changes and supports full undo/redo:
- Undo —
Ctrl+Z(orCmd+Zon Mac) - Redo —
Ctrl+Shift+Z(orCmd+Shift+Zon Mac)
Undo/redo applies to all data-modifying actions — adding/removing tables, editing columns, changing relationships, and more. Canvas movements (pan, zoom) and selections are not tracked in the undo history.
Keyboard Shortcuts
| Shortcut | Action |
|---|---|
Ctrl+Z | Undo |
Ctrl+Shift+Z | Redo |
Delete | Delete selected table or column |
Escape | Close property panel |
R | Add relationship |
Shift+A | Auto layout |