Database
AFFiNE’s Database feature provides powerful data management capabilities directly in your documents. Structure information with tables, visualize workflows with kanban boards, and browse media with gallery views—all while maintaining the flexibility of a document editor.Overview
Databases in AFFiNE are:- Block-based: Insert anywhere in documents or whiteboards
- Multi-view: Switch between table, kanban, and gallery layouts
- Collaborative: Real-time editing with team members
- Flexible: Custom properties with various data types
- Connected: Link to other pages and databases
Databases are built on the
@blocksuite/data-view framework, providing a modular and extensible architecture.Creating a Database
In Page Mode
- Type
/databasein the editor - Select “Database” from the slash menu
- Choose a view type (Table, Kanban, or Gallery)
- Start adding rows and columns
In Edgeless Mode
- Click the
+button or press/ - Select “Database”
- Draw on canvas to place database block
- Configure views and properties
View Types
AFFiNE supports three primary database views:- Table View
- Kanban View
- Gallery View
Traditional spreadsheet-style layoutPerfect for:
- Detailed data entry and analysis
- Sorting and filtering large datasets
- Quick scanning of information
- Bulk editing operations
- Multiple column types (text, number, date, select, etc.)
- Sort by any column (ascending/descending)
- Filter rows by conditions
- Group by property values
- Freeze header row
- Resize columns by dragging
- Hide/show columns
- Row selection and bulk operations
Property Types
Customize your database with various property types:Text Properties
- Text: Single-line text input
- Rich Text: Multi-line with formatting
- URL: Clickable web links
- Email: Email addresses
- Phone: Phone numbers
Number & Date
- Number: Integers and decimals
- Percent: Percentage values
- Currency: Money amounts
- Date: Date picker
- Created Time: Auto timestamp
- Last Edited: Auto update time
Selection
- Select: Single choice dropdown
- Multi-Select: Multiple choice tags
- Checkbox: Boolean true/false
- Status: Workflow stages
Relations
- Link to Page: Reference AFFiNE pages
- File & Media: Attachments and images
- Created By: User who created row
- Last Edited By: Last user to edit
Special Properties
Formula (Coming Soon)- Calculate values based on other properties
- Support for math, logic, and text functions
- Aggregate data from linked databases
- Link records between different databases
Sorting and Filtering
Sorting
Organize data by any property:- Click the Sort button in the toolbar
- Choose a property to sort by
- Select ascending or descending
- Add multiple sort levels for complex ordering
Filtering
Show only relevant rows:- Click the Filter button
- Add filter conditions:
is,is notcontains,does not containis empty,is not emptystarts with,ends withgreater than,less than(numbers/dates)
- Combine multiple filters with AND/OR logic
- Save filter presets for quick access
Grouping
Organize rows by property values:- Table view: Group rows into collapsible sections
- Kanban view: Columns represent groups
- Gallery view: Sections for each group value
- Status (To Do, In Progress, Done)
- Assignee (team members)
- Priority (High, Medium, Low)
- Tags and categories
Working with Rows
Adding Rows
- Click ”+ New” button at bottom
- Press
Enterin last cell (table view) - Click ”+” in kanban column header
- Drag a card to create in kanban
Editing Rows
- Click any cell to edit inline
- Double-click to open full-page view
- Tab to move between cells
- Shift + Tab to move backwards
Row Operations
- Duplicate: Right-click → Duplicate
- Delete: Right-click → Delete or press
Delete - Move: Drag rows to reorder (table view)
- Select multiple: Click checkbox to multi-select
- Bulk edit: Select multiple rows and edit properties
Column Management
Adding Columns
- Click ”+” in table header
- Choose property type
- Name the column
- Configure type-specific options
Column Options
- Rename: Double-click header
- Change Type: Right-click → Change property type
- Resize: Drag column border
- Reorder: Drag column header
- Hide: Right-click → Hide column
- Delete: Right-click → Delete property
Property Type Options
Property Type Options
Select & Multi-Select:
- Custom option names
- Color-coded tags
- Add/remove options
- Reorder options
- Decimal places
- Number format (1,000 vs 1000)
- Negative number display
- Date format (MM/DD/YYYY, etc.)
- Include time
- 12-hour vs 24-hour format
- Timezone
Database Title and Icon
- Title: Click to edit database name
- Icon: Click icon to choose emoji or upload image
- Description: Add context below title
- Cover Image: Add visual header (coming soon)
View Management
Creating Views
- Click view dropdown (Table/Kanban/Gallery)
- Click ”+ New View”
- Choose view type
- Name the view
- Configure filters, sorts, and display options
View-Specific Settings
Each view can have:- Independent filters and sorts
- Different visible columns (table)
- Custom card layouts (kanban/gallery)
- Unique grouping settings
Advanced Features
Templates
Create row templates for consistent data entry:- Create a sample row with default values
- Right-click → “Save as template”
- Access templates from ”+ New” dropdown
- One-click to create pre-filled rows
Comments
Collaborate on database rows:- Open full-page view of any row
- Click comment icon
- @mention team members
- Thread conversations per row
Export
Export database data:- CSV: Spreadsheet format
- Markdown: Table format
- HTML: Web-ready format
Keyboard Shortcuts
Table View
| Action | Shortcut |
|---|---|
| Edit cell | Enter or Double-click |
| Next cell | Tab |
| Previous cell | Shift + Tab |
| Next row | ↓ or Enter (in last column) |
| Previous row | ↑ |
| New row | Enter (in last cell) |
| Delete row | Delete (row selected) |
| Select row | Click row number |
| Multi-select | Shift + Click |
| Extend selection | Shift + ↑/↓ |
Kanban View
| Action | Shortcut |
|---|---|
| New card | Enter (in column) |
| Edit card | Click card |
| Move card | Drag to column |
| Open detail | Double-click card |
Use Cases
Task Management
Track to-dos, projects, and workflows with kanban boards and status fields
Content Calendar
Plan blog posts, social media, and campaigns with date and status tracking
CRM
Manage contacts, leads, and customer relationships with custom properties
Product Roadmap
Plan features, track progress, and prioritize with multi-select and dates
Asset Library
Organize design files, photos, and media with gallery view
Meeting Notes
Structure meeting agendas, attendees, and action items in tables
Integration with Documents
Inline Databases
Databases are first-class blocks in AFFiNE:- Mix with regular text and headings
- Embed in notes and project pages
- Place on whiteboards alongside diagrams
- Link database rows to page content
Linked Pages
Connect databases to your knowledge base:- Use “Link to Page” property type
- Reference any page in your workspace
- Bi-directional backlinks maintained
- Open linked pages in side panel
Performance
Databases are optimized for:- Large datasets: Thousands of rows
- Virtual scrolling: Smooth rendering
- Lazy loading: Load data as needed
- Incremental sync: Efficient collaboration
- Client-side filtering: Instant results
Databases use the same Y.js CRDT technology as the editor for conflict-free collaborative editing.