Skip to main content

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

  1. Type /database in the editor
  2. Select “Database” from the slash menu
  3. Choose a view type (Table, Kanban, or Gallery)
  4. Start adding rows and columns

In Edgeless Mode

  1. Click the + button or press /
  2. Select “Database”
  3. Draw on canvas to place database block
  4. Configure views and properties

View Types

AFFiNE supports three primary database views:
Traditional spreadsheet-style layoutPerfect for:
  • Detailed data entry and analysis
  • Sorting and filtering large datasets
  • Quick scanning of information
  • Bulk editing operations
Features:
  • 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
Rollup (Coming Soon)
  • Aggregate data from linked databases
Relation (Coming Soon)
  • Link records between different databases

Sorting and Filtering

Sorting

Organize data by any property:
  1. Click the Sort button in the toolbar
  2. Choose a property to sort by
  3. Select ascending or descending
  4. Add multiple sort levels for complex ordering
In Table view, click any column header to quickly sort by that property.

Filtering

Show only relevant rows:
  1. Click the Filter button
  2. Add filter conditions:
    • is, is not
    • contains, does not contain
    • is empty, is not empty
    • starts with, ends with
    • greater than, less than (numbers/dates)
  3. Combine multiple filters with AND/OR logic
  4. 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
Common grouping properties:
  • 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 Enter in 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

  1. Click ”+” in table header
  2. Choose property type
  3. Name the column
  4. 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
Select & Multi-Select:
  • Custom option names
  • Color-coded tags
  • Add/remove options
  • Reorder options
Number:
  • Decimal places
  • Number format (1,000 vs 1000)
  • Negative number display
Date:
  • 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

  1. Click view dropdown (Table/Kanban/Gallery)
  2. Click ”+ New View”
  3. Choose view type
  4. Name the view
  5. 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
Use multiple views to show the same data in different ways—e.g., a table view for data entry and a kanban view for workflow tracking.

Advanced Features

Templates

Create row templates for consistent data entry:
  1. Create a sample row with default values
  2. Right-click → “Save as template”
  3. Access templates from ”+ New” dropdown
  4. 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
Right-click database → Export → Choose format

Keyboard Shortcuts

Table View

ActionShortcut
Edit cellEnter or Double-click
Next cellTab
Previous cellShift + Tab
Next row or Enter (in last column)
Previous row
New rowEnter (in last cell)
Delete rowDelete (row selected)
Select rowClick row number
Multi-selectShift + Click
Extend selectionShift + ↑/↓

Kanban View

ActionShortcut
New cardEnter (in column)
Edit cardClick card
Move cardDrag to column
Open detailDouble-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.

Next Steps