Skip to content

API > @blocksuite/blocks > DatabaseBlockModel

Class: DatabaseBlockModel ​

Extends ​

Constructors ​

constructor ​

new DatabaseBlockModel(): DatabaseBlockModel

Returns ​

DatabaseBlockModel

Inherited from ​

BaseBlockModel.constructor

Defined In ​

packages/store/dist/schema/base.d.ts:100

Properties ​

cells ​

cells: SerializedCells

Defined In ​

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

Inherited from ​

BaseBlockModel.cells


childMap ​

childMap: Map< string, number >

Defined In ​

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

Inherited from ​

BaseBlockModel.childMap


children ​

children: BaseBlockModel< object >[]

Defined In ​

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

Inherited from ​

BaseBlockModel.children


childrenUpdated ​

childrenUpdated: Slot< void >

Defined In ​

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

Inherited from ​

BaseBlockModel.childrenUpdated


columns ​

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

Defined In ​

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

Inherited from ​

BaseBlockModel.columns


created ​

created: Slot< void >

Defined In ​

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

Inherited from ​

BaseBlockModel.created


deleted ​

deleted: Slot< void >

Defined In ​

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

Inherited from ​

BaseBlockModel.deleted


flavour ​

flavour: string

Defined In ​

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

Inherited from ​

BaseBlockModel.flavour


id ​

id: string

Defined In ​

packages/store/dist/schema/base.d.ts:105

Inherited from ​

BaseBlockModel.id


keys ​

keys: string[]

Defined In ​

packages/store/dist/schema/base.d.ts:107

Inherited from ​

BaseBlockModel.keys


page ​

page: Page

Defined In ​

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

Inherited from ​

BaseBlockModel.page


propsUpdated ​

propsUpdated: Slot< {newProps: unknown; oldProps: unknown;} >

Defined In ​

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

Inherited from ​

BaseBlockModel.propsUpdated


role ​

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

Defined In ​

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

Inherited from ​

BaseBlockModel.role


text ​

optional text: Text

Defined In ​

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

Inherited from ​

BaseBlockModel.text


title ​

title: Text

Defined In ​

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

Inherited from ​

BaseBlockModel.title


views ​

views: (TableViewData & CommonViewDataType & {mode: "table";} | KanbanViewData & CommonViewDataType & {mode: "kanban";})[]

Defined In ​

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

Inherited from ​

BaseBlockModel.views


yBlock ​

yBlock: YBlock

Defined In ​

packages/store/dist/schema/base.d.ts:106

Inherited from ​

BaseBlockModel.yBlock

Methods ​

addColumn ​

addColumn(position, column): string

Parameters ​

ParameterType
positionInsertToPosition
columnOmit< Column< Record< string, unknown > >, "id" > & {id: string;}

Returns ​

string

Defined In ​

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


addView ​

addView(type): TableViewData & CommonViewDataType & {mode: "table";} | KanbanViewData & CommonViewDataType & {mode: "kanban";}

Parameters ​

ParameterType
type"table" | "kanban"

Returns ​

TableViewData & CommonViewDataType & {mode: "table";} | KanbanViewData & CommonViewDataType & {mode: "kanban";}

Defined In ​

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


applyColumnUpdate ​

applyColumnUpdate(): void

Returns ​

void

Defined In ​

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


applyViewsUpdate ​

applyViewsUpdate(): void

Returns ​

void

Defined In ​

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


clone ​

clone(): DatabaseBlockModel

Returns ​

DatabaseBlockModel

Inherited from ​

BaseBlockModel.clone

Defined In ​

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


copyCellsByColumn ​

copyCellsByColumn(fromId, toId): void

Parameters ​

ParameterType
fromIdstring
toIdstring

Returns ​

void

Defined In ​

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


deleteColumn ​

deleteColumn(columnId): void

Parameters ​

ParameterType
columnIdstring

Returns ​

void

Defined In ​

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


deleteView ​

deleteView(id): void

Parameters ​

ParameterType
idstring

Returns ​

void

Defined In ​

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


dispose ​

dispose(): void

Returns ​

void

Inherited from ​

BaseBlockModel.dispose

Defined In ​

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


duplicateView ​

duplicateView(id): string

Parameters ​

ParameterType
idstring

Returns ​

string

Defined In ​

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


findColumnIndex ​

findColumnIndex(id): number

Parameters ​

ParameterType
idstring

Returns ​

number

Defined In ​

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


firstChild ​

firstChild(): null | BaseBlockModel< object >

Returns ​

null | BaseBlockModel< object >

Inherited from ​

BaseBlockModel.firstChild

Defined In ​

packages/store/dist/schema/base.d.ts:119


firstItem ​

firstItem(): null | BaseBlockModel< object >

Returns ​

null | BaseBlockModel< object >

Inherited from ​

BaseBlockModel.firstItem

Defined In ​

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


getCell ​

getCell(rowId, columnId): null | Cell

Parameters ​

ParameterType
rowIdstring
columnIdstring

Returns ​

null | Cell

Defined In ​

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


getColumn ​

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

Parameters ​

ParameterType
idstring

Returns ​

undefined | Column< Record< string, unknown > >

Defined In ​

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


getViewList ​

getViewList(): (TableViewData & CommonViewDataType & {mode: "table";} | KanbanViewData & CommonViewDataType & {mode: "kanban";})[]

Returns ​

(TableViewData & CommonViewDataType & {mode: "table";} | KanbanViewData & CommonViewDataType & {mode: "kanban";})[]

Defined In ​

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


initConvert ​

initConvert(viewType): void

Parameters ​

ParameterType
viewType"table" | "kanban"

Returns ​

void

Defined In ​

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


initEmpty ​

initEmpty(viewType): void

Parameters ​

ParameterType
viewType"table" | "kanban"

Returns ​

void

Defined In ​

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


initTemplate ​

initTemplate(viewType): void

Parameters ​

ParameterType
viewType"table" | "kanban"

Returns ​

void

Defined In ​

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


isEmpty ​

isEmpty(): boolean

Returns ​

boolean

Inherited from ​

BaseBlockModel.isEmpty

Defined In ​

packages/store/dist/schema/base.d.ts:118


lastChild ​

lastChild(): null | BaseBlockModel< object >

Returns ​

null | BaseBlockModel< object >

Inherited from ​

BaseBlockModel.lastChild

Defined In ​

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


lastItem ​

lastItem(): null | BaseBlockModel< object >

Returns ​

null | BaseBlockModel< object >

Inherited from ​

BaseBlockModel.lastItem

Defined In ​

packages/store/dist/schema/base.d.ts:122


moveViewTo ​

moveViewTo(id, position): void

Parameters ​

ParameterType
idstring
positionInsertToPosition

Returns ​

void

Defined In ​

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


updateCell ​

updateCell(rowId, cell): void

Parameters ​

ParameterType
rowIdstring
cellCell

Returns ​

void

Defined In ​

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


updateCells ​

updateCells(columnId, cells): void

Parameters ​

ParameterType
columnIdstring
cellsRecord< string, unknown >

Returns ​

void

Defined In ​

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


updateColumn ​

updateColumn(id, updater): undefined | string

Parameters ​

ParameterType
idstring
updaterColumnUpdater

Returns ​

undefined | string

Defined In ​

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


updateView ​

updateView(id, update): void

Parameters ​

ParameterType
idstring
updatefunction

Returns ​

void

Defined In ​

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