Docs

Blocks with Databases

The customized data source and indexing ability of database are not finished yet with current AFFiNE(0.12), but they will be updated soon (planned in 0.14).

Database is designed to make blocks in AFFiNE connected and programmable.

Within AFFiNE, a container managing a group of blocks is a Database. Databases can have various views and organizational relationships. In fact, according to AFFiNE’s product philosophy, a Page is a type of Database, as is Edgeless. When a group of blocks is arranged in a regular vertical sequence (y), it forms a page. If a group of blocks is placed arbitrarily in spatial space (x+y+z), it is considered edgeless . Naturally, if a group of blocks is neatly organized in columns, similar to a Table, then it is recognized as a conventional Database (Table View).

You may index, update, group, or make relations between blocks through database. The blocks come with its infomation and properties(in fact a manifold), and the database is a cooradinate system for you observe it. Naturally, database is the core design that enable us to transform blocks in different views, and we will support customized views for blocks and pages in the near future.

The name “AFFiNE” was picked to indicating this ability of “seeing unified blocks in arbitrary ways”.

Creating a Database

A Database can be created by selecting a group of blocks, whether in a document or in Edgeless (Work In Progress).

Many Views

We are committed to adding more Views to the Database:

  • Table View ✅

  • Kanban View ✅

  • Card View [WIP]

  • List View [WIP]

  • Calendar View [Plan]

  • Timeline View [Plan]

  • Map View [Plan]

  • Gallery View [Plan]

  • Stack View [Plan]

However, a few special Views require clarification:

  • Page View: The standard view of a document.

  • Edgeless View: The standard view in Edgeless mode.

  • Frame/Group: A collection of blocks in Edgeless mode.

Seamless Transformation

The content of a group of blocks should be capable of transforming seamlessly between different Views of a Database. These transformations allow them to adopt various forms and roles within our workflows.

For instance, a Table can be converted into a Kanban, and then, through filtering, some blocks can be changed to a List View.

We will gradually deepen this concept. However, there’s no need for concern beforehand; it will emerge in an intuitive manner. Beyond the conventional switching of views within the same dataset, we will introduce special transformations:

  • Edgeless and Page: Switch between Page mode or Edgeless mode as the container of blocks

  • Database to Group/Frame: A database on the whiteboard can be broken down into a Group or Frame.

  • **Database to Page/Edgeless:**A database can be fully converted into a Page View/Edgeless View within a document.

  • Each row in a Database can become a Page/Edgeless: every row in the Database can include complex attributes and content, turning that row into a separate page.

  • Group/Frame to Database: A group or a frame can be converted into a database.

These special view transformations will gradually complete the philosophy that “a container managing a group of blocks is a Database”.

Imagine, after brainstorming on a whiteboard with others, these ideas can immediately be organized into a draft outline. With the help of AI, there’s even the potential to obtain a more readable draft.

From a more abstract perspective, depending on the transformation between different views, you can freely insert unstructured content into an orderly text structure or quickly organize structured content from unstructured beginnings.

Thanks to HTML including Canvas, from the structured DOM to the Canvas describing pixel information, AFFiNE enables you to freely arrange content for both the left and right brain, maximizing mental productivity.