Tables & Fields
Tables define your data models. Each table has an id, name, fields, and optional permissions, indexes, and views.
Table Structure
Each table has an id, name, fields array, and optional permissions and indexes.
tables:
- id: 1
name: tasks
fields:
- id: 1
name: title
type: single-line-text
required: true
- id: 2
name: completed
type: checkbox
permissions:
create: authenticated
read: all
update: [admin, member]
delete: [admin]
indexes:
- fields: [title]
unique: trueTable Properties
Each table in the tables array accepts the following properties.
Base Field Properties
Every field has these base properties: id (unique integer), name (identifier), type (one of 41 types), and optional required, unique, indexed, and default.
41 Field Types
Field types are organized into 9 categories:
Text Fields
Fields for textual content, from short labels to rich formatted text and structured strings.
fields:
- id: 1
name: title
type: single-line-text
required: true
- id: 2
name: notes
type: rich-text
maxLength: 5000
fullTextSearch: trueNumeric Fields
Fields for numbers, currencies, percentages, ratings, and progress indicators.
fields:
- id: 1
name: price
type: currency
currency: USD
precision: 2
symbolPosition: before
- id: 2
name: satisfaction
type: rating
max: 5
style: starsSelection Fields
Fields for choosing from predefined options: single or multi-select with string arrays. Use the status field type for colored workflow states.
fields:
- id: 1
name: priority
type: single-select
options: [Low, Medium, High]
- id: 2
name: tags
type: multi-select
maxSelections: 5
options: [Frontend, Backend, DevOps]Date & Time Fields
Fields for dates, times, timestamps, and duration values.
User & Audit Fields
Auto-populated fields tracking who created/updated/deleted a record and when. Requires auth to be configured.
fields:
- id: 1
name: created
type: created-at
- id: 2
name: updated
type: updated-at
- id: 3
name: deleted
type: deleted-at
- id: 4
name: author
type: created-by
- id: 5
name: editor
type: updated-by
- id: 6
name: remover
type: deleted-byAttachment Fields
Computed Fields
fields:
- id: 1
name: total
type: formula
formula: "price * quantity"
resultType: decimal
- id: 2
name: ticket_number
type: autonumber
prefix: "TKT-"
startFrom: 1000
digits: 5Advanced Fields
Relational Fields
Four field types enable cross-table relationships: relationship, lookup, rollup, and count. These form a chain. Relationship defines the link, then lookup, rollup, and count derive data from it.
relationship
Creates a foreign-key link to another table. Foundation for all relational features.
lookup
Reads a field value from a related record via an existing relationship. Read-only and auto-updated.
rollup
Aggregates values from multiple related records (sum, avg, count, min, max, etc.).
count
Counts the number of related records. A simplified rollup with aggregation always set to count.
tables:
- name: customers
fields:
- { id: 1, name: email, type: email }
- { id: 2, name: full_name, type: single-line-text }
- name: orders
fields:
- { id: 1, name: customer, type: relationship,
relatedTable: customers, relationType: many-to-one }
- { id: 2, name: customer_email, type: lookup,
relationshipField: customer, relatedField: email }
- { id: 3, name: total, type: currency, currency: USD }
- name: customers # add rollup to customers
fields:
- { id: 3, name: order_count, type: count,
relationshipField: orders }
- { id: 4, name: total_spent, type: rollup,
relationshipField: orders,
relatedField: total, aggregation: sum }Relational chain
Start with a relationship field to create the link, then use lookup, rollup, or count to derive data without duplication. Example: orders → customer (relationship) → customer_email (lookup).
Permissions (RBAC)
Table permissions use role-based access control. Each permission accepts: "all" (public), "authenticated" (logged-in users), or an array of role names.
permissions:
create: authenticated
read: all
update: [admin, member]
delete: [admin]
comment: authenticated
fields:
salary:
read: [admin, hr]
update: [admin]
notes:
read: [admin, member]
update: [admin, member]Three access levels
"all" for public access, "authenticated" for any logged-in user, or an array of role names like [admin, member] for specific roles.
Security best practice
Unauthorized access returns 404 (not 403) to prevent attackers from discovering which resources exist. This follows OWASP recommendations for resource enumeration prevention.
Indexes & Constraints
Optimize queries with indexes and enforce data integrity with uniqueness and check constraints.
Indexes
Unique Constraints
Check Constraints
tables:
- name: products
fields:
- { id: 1, name: sku, type: single-line-text }
- { id: 2, name: price, type: decimal, min: 0 }
- { id: 3, name: category, type: single-line-text }
indexes:
- name: idx_sku
fields: [sku]
unique: true
- name: idx_category_price
fields: [category, price]
uniqueConstraints:
- name: uq_sku
fields: [sku]
constraints:
- name: chk_positive_price
check: "price > 0"