Database
A full relational database embedded directly in a document. Rows, columns, multiple views, filters, sorts, cross-database relations, rollups, formulas, automations, and a Focus mode with a Pomodoro timer — all living alongside your other blocks with no separate app or sync required.
What it is
The Database block is a self-contained data layer. Each database has a name, a set of typed columns, an unlimited number of rows, and one or more views — each view is a different lens on the same underlying data. Adding a row in the Board view makes it appear immediately in the Table, Calendar, and Chart views.
| Task | Status | Priority | Due date | Owner |
|---|---|---|---|---|
| Redesign onboarding | Done | High | Jun 12 | Ezra |
| Fix Yjs sync bug | In progress | Critical | Jun 18 | Ezra |
| Write database docs | In review | Normal | Jun 26 | Ezra |
Adding a Database block
/ on any empty paragraph, type database, press Enter. A new empty database is created inline.+ on any block → scroll to Advanced → Database.Column types
Every column has a type that controls how values are stored, displayed, and interacted with. Relation, rollup, and formula columns are computed or linked — they cannot be edited directly.
| Type | Category | Description |
|---|---|---|
| text | Basic | Single-line text. The first text column is the row title — it gets the peek and page controls. |
| number | Basic | Numeric value. Supports decimals. Used as Y-axis source in Chart view. |
| select | Basic | Single-choice dropdown from a predefined option set. 8 color choices per option. Used as board group-by and calendar color. |
| multiselect | Basic | Multiple choices from the same option set. Options shown as colored badges. |
| date | Basic | Date picker. Calendar view requires at least one date column. |
| checkbox | Basic | Boolean toggle. Rollup % Checked aggregation is available for checkbox columns. |
| url | Basic | Validated URL. Renders as a clickable link in the row peek. |
| Basic | Email address. Includes a contact picker that searches document members and contacts. | |
| relation | Computed | Cross-database link. Creates a two-way connection between rows in different databases. Mirror relations reflect the inverse side automatically. |
| rollup | Computed | Aggregates values from linked rows via a relation column. Supports filtered rollup — only rows matching a condition are included. |
| formula | Computed | Computed value from an expression referencing other columns. Evaluated client-side via FormulaEngine. |
Column settings
Click any column header to open the column menu. From there you can rename the column, change its type, reorder it, resize it, hide it from the current view, or delete it. Changing a column type preserves the raw cell values where possible.
Relations
A relation column links rows in this database to rows in another database (or the same one). Each link is stored as a join record — adding or removing a link toggles that record without modifying either row's data.
Column menu → Add column → type Relation → pick the target database from the dropdown.
Click a relation cell in any row. A search picker opens showing all rows in the target database. Click a row to toggle the link on or off. Multiple rows can be linked simultaneously.
When creating the relation, check Mirror to create a corresponding read-only relation column in the target database that shows which rows link back.
Rollups
A rollup reads values from a column in linked rows (via a relation) and aggregates them into a single number per row.
| Aggregation | Description |
|---|---|
| count | Number of linked rows. |
| sum | Sum of a numeric column across linked rows. |
| avg | Average of a numeric column. |
| min | Minimum value of a numeric column. |
| max | Maximum value of a numeric column. |
| % checked | Percentage of linked rows where a checkbox column is true. |
Filtered rollup
A rollup can optionally filter which linked rows are included before aggregating. Set a filter column, operator, and value in the rollup column settings — only linked rows matching the condition count toward the result. Useful for aggregating only completed tasks, only high-priority items, and so on.
Formulas
Formula columns evaluate an expression against each row's cell values. Expressions reference columns by name using {} syntax and support arithmetic, comparison operators, and built-in functions via FormulaEngine. Results are computed client-side and re-evaluated whenever a referenced cell changes.
Views
Every database starts with a Table view. Additional views can be added from the view tab bar — each is a named, independently-configured lens on the same rows. Views can be renamed or deleted (at least one must remain).
Table view
The default spreadsheet-style grid. Rows are displayed as horizontal records; columns are typed fields. Click any cell to edit it inline. The first text column shows row controls on hover — a peek icon (slide-in panel) and a full-page icon.
Board view (Kanban)
Groups rows into vertical columns by a select column. Each column is color-coded by its option's color. Rows appear as cards showing the title and up to 3 additional fields.
Gallery view
A 2–3 column card grid. Each card shows a color strip from the first select column, the row title, and up to 4 additional field values. Click any card to open the row peek. Useful for visual content inventories, portfolios, and product grids.
Calendar view
A monthly calendar that places rows on the date stored in a chosen date column. Up to 3 rows are shown per day cell; overflow shows a "+N more" count. Row pills are color-coded by the first select column.
Chart view
Visualises the database as a Bar, Line, Area, or Pie chart. Configure the X axis (any column), Y axis (row count or sum of a numeric column), and an optional secondary Group by dimension for multi-series charts. A stats strip above the chart shows total rows, data points, max, and average.
Focus view
A task-focused mode with a built-in Pomodoro timer. The view surfaces your highest-priority incomplete tasks, lets you start/mark done/skip them one at a time, and tracks overall completion progress.
Filters and sorts
Filters and sorts are per-view — each view has its own independent configuration. They are toggled from the toolbar using the Filter and Sort buttons. An active count badge appears on each button when rules are set.
Filters
| Operator | Works on | Description |
|---|---|---|
| contains | text, select, multiselect | Value includes the filter string. |
| is | all types | Exact match. For select, matches the option label. |
| is not | all types | Excludes exact matches. |
| is empty | all types | Cell has no value. |
| is not empty | all types | Cell has any value. |
| gt / lt | number, date | Greater than / less than for numeric comparison. |
Sorts
Add one or more sort rules from the Sort panel. Each rule specifies a column and direction (ascending or descending). Multiple sorts are applied in order — the first rule is the primary sort, subsequent rules break ties.
Row color rules
Conditional formatting for table rows. Each rule specifies a column, an operator, a value to match, and a background color. The first matching rule wins — rules are evaluated in order. Matched rows can also have a custom text color, a left border accent, and a strikethrough style applied simultaneously.
| Task | Status | Due date |
|---|---|---|
| Write database docs | In progress | Jun 26 |
| Deploy v3 | To do | Jun 10 ⚠ |
Field rules
Conditional column visibility. A field rule hides a specific column when a condition is met across the majority of rows. For example, hide the "Review notes" column when the "Status" column is not "In review" for most rows.
Row peek
Every row has a dedicated page — a full document with a block editor and a property panel. The peek is a slide-in modal that shows this page without leaving the database view.
The peek has two sections: a property panel at the top showing all non-computed column values with inline editors, and a full block editor below for freeform notes, attachments, and embedded blocks. The property panel saves on a 400ms debounce per field.
Automations
Automations run server-side logic when database events occur. Each automation has one or more triggers, a trigger operator (AND / OR), and one or more actions that fire when the conditions are met.
Triggers
status_changed_to triggers on one automation with OR operator lets you react to any of several status transitions.Actions
{Column Name} tokens that resolve to the row\'s live cell values. For select, email, checkbox, number, and date columns, a static value is stored directly.{Column Name} tokens resolved against the triggering row.view.config.automations and collected across all views at runtime. An automation can be enabled or disabled individually without deleting it.Template tokens
Template strings in set_column and notify actions support tokens in the format {Column Name}. The token is replaced with the triggering row's value for that column at the moment the automation fires. Token resolution handles select (returns label), multiselect (comma-joined labels), checkbox (Yes/No), and date (formatted as "Jun 26, 2026").
Export and import
Export
The database toolbar includes Download and Upload buttons. Export downloads the current view's visible rows (after filters and sorts) in two formats:
Import
Paste CSV text into the import modal. The importer matches CSV column headers to existing database columns by name (case-insensitive). Columns that match are populated; unmatched CSV columns are ignored. Each parsed row is added as a new database row — existing rows are not modified.
Search
The search field in the database toolbar filters the visible rows client-side across all text, number, email, and URL column values. The search is a simple case-insensitive substring match applied on top of any active view filters. Clearing the search restores all filter-passing rows.
Publishing
On published pages, the database renders in read-only Table view. Column types, select option colors, and row data are all visible. Relation, rollup, and formula columns are rendered as their resolved values. The row peek, property panel, and block editor are available on published pages — visitors can open a row peek but cannot edit cell values.