Database

Design your database visually — create tables, add fields, and set up relationships.

Database

Design your database visually — create tables, add fields, set up relationships. No SQL required.

The database tables list showing all tables in the project
All your tables at a glance

Quick walkthrough

Create a table

Click Database in the sidebar, then Add Table. Give it a name like cases. An id column is added automatically.

Add fields

Click Add Field and choose a type (Text, Number, Boolean, Date, etc.). Set whether the field is required, unique, or has a default value.

Save

Click Save and your table is created. Spala handles the database setup for you.

Good to know

Spala uses PostgreSQL under the hood. You never need to write SQL, but you can use Raw SQL steps in your functions if you want to.

Use your tables in functions

Once your tables exist, you interact with them through Database Query steps in your functions:

- Select — Read rows with conditions, sorting, and pagination
- Insert — Create new rows
- Update — Modify existing rows
- Delete — Remove rows

Schema Visualizer

Click the Visualize button (the link icon next to DATABASE in the sidebar header) to open an interactive ER diagram of your entire database.

The Schema Visualizer showing an ER diagram with all tables, fields, and relationship lines
See all your tables and relationships in one diagram

The visualizer shows:

- Every table with its fields, types, and constraints
- Primary keys (🔑) and foreign keys (→) highlighted
- Relationship lines connecting tables through foreign key references
- Reset Layout to auto-arrange the diagram

Click any table's edit icon to jump directly to its schema editor. Drag tables to rearrange the layout.

Learn more

Tables & Fields
Create tables, add fields, and manage your schema.
/database/tables
Relationships
Connect tables with foreign keys for one-to-many and many-to-many patterns.
/database/relationships
Database Steps
/reference/steps/database
Reference for all database step types in functions
Database Triggers
/triggers/database-triggers
Auto-run logic when rows are inserted, updated, or deleted
Publish
/features/publish-export
Make your project API live after schema changes