Phase C of docs/AFFINE.md (ADR-13).
A database is a block whose records live in the page's Y.Doc, in
ydoc.getMap("blocks") under the block's id: columns, rows (each cell its
own map entry, so concurrent edits to one row merge) and views. Order is
a fractional position per item, so moving a row keeps edits made to it at
the same time. Database edits share the page's undo history.
- Thirteen property types: title, text, number, checkbox, select,
multi-select, date, progress, link, attachment, member, created time
and created by. The column menu renames, changes type (converting the
values), sorts, filters, hides, inserts, moves, duplicates and deletes;
columns resize and drag.
- Table view: keyboard navigation, range selection, typing to edit,
copy and paste with spreadsheets (pasting adds rows as needed), row
dragging, bulk delete, grouping.
- Views in tabs, each with its own filters (all/any), sorts, grouping
and visible properties; kanban grouped by select, multi-select,
checkbox or member with cards dragged between columns; calendar by a
date property with records dragged between days.
- A record opens beside the page with its properties and a body of its
own (a Y.XmlFragment in the row, edited by a second editor).
- /database, Ctrl+G or "Group as database" turns a list into a database;
CSV export and import; a copied, pasted or duplicated database gets
its own copy of the records.
Server: yrs writes each database's records into its node as attrs.data
when it turns a document into JSON, adds them to the search text, and
writes them back on imports, restores and templates. Markdown, HTML,
PDF and Word exports show a database as a table of its first view's
columns. Notion database CSVs import as database blocks with guessed
types. Share links and history previews show databases read-only.
Strings are translated into all five languages, the user guide covers
databases, and the mobile editor bundle is rebuilt.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>