Skip to content

BlockSuite API Documentation / @blocksuite/blocks / DatabaseBlockModel

Class: DatabaseBlockModel

Extends

Constructors

new DatabaseBlockModel(undefined)

new DatabaseBlockModel(): DatabaseBlockModel

Returns

DatabaseBlockModel

Inherited from

BlockModel<DatabaseBlockProps>.constructor

Source

packages/framework/store/dist/schema/base.d.ts:99

Properties

[modelLabel]

[modelLabel]: DatabaseBlockProps

Inherited from

BlockModel.[modelLabel]

Source

packages/framework/store/dist/schema/base.d.ts:101


cells

cells: SerializedCells

Inherited from

BlockModel.cells

Source

packages/blocks/src/database-block/database-model.ts:17


childrenUpdated

childrenUpdated: Slot<void>

Inherited from

BlockModel.childrenUpdated

Source

packages/framework/store/dist/schema/base.d.ts:120


columns

columns: Column<Record<string, unknown>>[]

Inherited from

BlockModel.columns

Source

packages/blocks/src/database-block/database-model.ts:18


created

created: Slot<void>

Inherited from

BlockModel.created

Source

packages/framework/store/dist/schema/base.d.ts:115


deleted

deleted: Slot<void>

Inherited from

BlockModel.deleted

Source

packages/framework/store/dist/schema/base.d.ts:116


flavour

flavour: string

Inherited from

BlockModel.flavour

Source

packages/framework/store/dist/schema/base.d.ts:103


id

id: string

Inherited from

BlockModel.id

Source

packages/framework/store/dist/schema/base.d.ts:109


keys

keys: string[]

Inherited from

BlockModel.keys

Source

packages/framework/store/dist/schema/base.d.ts:111


page

page: Doc

Deprecated

use doc instead

Inherited from

BlockModel.page

Source

packages/framework/store/dist/schema/base.d.ts:108


pop

pop: (prop) => void

Parameters

prop: "title" | "views" | "cells" | "columns"

Returns

void

Inherited from

BlockModel.pop

Source

packages/framework/store/dist/schema/base.d.ts:113


propsUpdated

propsUpdated: Slot<Object>

Type declaration

key

key: string

Inherited from

BlockModel.propsUpdated

Source

packages/framework/store/dist/schema/base.d.ts:117


role

role: "root" | "hub" | "content"

Inherited from

BlockModel.role

Source

packages/framework/store/dist/schema/base.d.ts:104


stash

stash: (prop) => void

Parameters

prop: "title" | "views" | "cells" | "columns"

Returns

void

Inherited from

BlockModel.stash

Source

packages/framework/store/dist/schema/base.d.ts:112


text?

optional text: Text

Inherited from

BlockModel.text

Source

packages/framework/store/dist/schema/base.d.ts:114


title

title: Text

Inherited from

BlockModel.title

Source

packages/blocks/src/database-block/database-model.ts:16


version

version: number

Inherited from

BlockModel.version

Source

packages/framework/store/dist/schema/base.d.ts:102


views

views: (TableViewData & CommonViewDataType & Object | KanbanViewData & CommonViewDataType & Object)[]

Inherited from

BlockModel.views

Source

packages/blocks/src/database-block/database-model.ts:15


yBlock

yBlock: YBlock

Inherited from

BlockModel.yBlock

Source

packages/framework/store/dist/schema/base.d.ts:110

Accessors

childMap

get childMap(): Map<string, number>

Returns

Map<string, number>

Source

packages/framework/store/dist/schema/base.d.ts:123


children

get children(): BlockModel<object>[]

Returns

BlockModel<object>[]

Source

packages/framework/store/dist/schema/base.d.ts:124


doc

get doc(): Doc

set doc(doc): void

Parameters

doc: Doc

Returns

Doc

Source

packages/framework/store/dist/schema/base.d.ts:121

Methods

addColumn()

addColumn(position, column): string

Parameters

position: InsertToPosition

column: Omit<Column<Record<string, unknown>>, "id"> & Object

Returns

string

Source

packages/blocks/src/database-block/database-model.ts:167


addView()

addView(type): TableViewData & CommonViewDataType & Object | KanbanViewData & CommonViewDataType & Object

Parameters

type: "table" | "kanban"

Returns

TableViewData & CommonViewDataType & Object | KanbanViewData & CommonViewDataType & Object

Source

packages/blocks/src/database-block/database-model.ts:90


applyColumnUpdate()

applyColumnUpdate(): void

Returns

void

Source

packages/blocks/src/database-block/database-model.ts:153


applyViewsUpdate()

applyViewsUpdate(): void

Returns

void

Source

packages/blocks/src/database-block/database-model.ts:147


copyCellsByColumn()

copyCellsByColumn(fromId, toId): void

Parameters

fromId: string

toId: string

Returns

void

Source

packages/blocks/src/database-block/database-model.ts:242


deleteColumn()

deleteColumn(columnId): void

Parameters

columnId: string

Returns

void

Source

packages/blocks/src/database-block/database-model.ts:203


deleteView()

deleteView(id): void

Parameters

id: string

Returns

void

Source

packages/blocks/src/database-block/database-model.ts:115


dispose()

dispose(): void

Returns

void

Inherited from

BlockModel.dispose

Source

packages/framework/store/dist/schema/base.d.ts:129


duplicateView()

duplicateView(id): string

Parameters

id: string

Returns

string

Source

packages/blocks/src/database-block/database-model.ts:99


findColumnIndex()

findColumnIndex(id): number

Parameters

id: string

Returns

number

Source

packages/blocks/src/database-block/database-model.ts:159


firstChild()

firstChild(): null | BlockModel<object>

Returns

null | BlockModel<object>

Inherited from

BlockModel.firstChild

Source

packages/framework/store/dist/schema/base.d.ts:126


getCell()

getCell(rowId, columnId): null | Cell

Parameters

rowId: string

columnId: string

Returns

null | Cell

Source

packages/blocks/src/database-block/database-model.ts:212


getColumn()

getColumn(id): undefined | Column<Record<string, unknown>>

Parameters

id: string

Returns

undefined | Column<Record<string, unknown>>

Source

packages/blocks/src/database-block/database-model.ts:163


getViewList()

getViewList(): (TableViewData & CommonViewDataType & Object | KanbanViewData & CommonViewDataType & Object)[]

Returns

(TableViewData & CommonViewDataType & Object | KanbanViewData & CommonViewDataType & Object)[]

Source

packages/blocks/src/database-block/database-model.ts:30


initConvert()

initConvert(viewType): void

Parameters

viewType: "table" | "kanban"

Returns

void

Source

packages/blocks/src/database-block/database-model.ts:42


initEmpty()

initEmpty(viewType): void

Parameters

viewType: "table" | "kanban"

Returns

void

Source

packages/blocks/src/database-block/database-model.ts:34


initTemplate()

initTemplate(viewType): void

Parameters

viewType: "table" | "kanban"

Returns

void

Source

packages/blocks/src/database-block/database-model.ts:50


isEmpty()

isEmpty(): boolean

Returns

boolean

Inherited from

BlockModel.isEmpty

Source

packages/framework/store/dist/schema/base.d.ts:125


lastChild()

lastChild(): null | BlockModel<object>

Returns

null | BlockModel<object>

Inherited from

BlockModel.lastChild

Source

packages/framework/store/dist/schema/base.d.ts:127


lastItem()

lastItem(): null | BlockModel<object>

Returns

null | BlockModel<object>

Inherited from

BlockModel.lastItem

Source

packages/framework/store/dist/schema/base.d.ts:128


moveViewTo()

moveViewTo(id, position): void

Parameters

id: string

position: InsertToPosition

Returns

void

Source

packages/blocks/src/database-block/database-model.ts:136


updateCell()

updateCell(rowId, cell): void

Parameters

rowId: string

cell: Cell

Returns

void

Source

packages/blocks/src/database-block/database-model.ts:229


updateCells()

updateCells(columnId, cells): void

Parameters

columnId: string

cells: Record<string, unknown>

Returns

void

Source

packages/blocks/src/database-block/database-model.ts:256


updateColumn()

updateColumn(id, updater): undefined | string

Parameters

id: string

updater: ColumnUpdater

Returns

undefined | string

Source

packages/blocks/src/database-block/database-model.ts:191


updateView()

updateView(id, update): void

Parameters

id: string

update

Returns

void

Source

packages/blocks/src/database-block/database-model.ts:122