API > @blocksuite/blocks > DatabaseBlockModel
Class: DatabaseBlockModel ​
Extends ​
Constructors ​
constructor ​
new DatabaseBlockModel():
DatabaseBlockModel
Returns ​
Inherited from ​
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 ​
children ​
children:
BaseBlockModel
<object
>[]
Defined In ​
packages/store/dist/schema/base.d.ts:117
Inherited from ​
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 ​
deleted ​
deleted:
Slot
<void
>
Defined In ​
packages/store/dist/schema/base.d.ts:110
Inherited from ​
flavour ​
flavour:
string
Defined In ​
packages/store/dist/schema/base.d.ts:102
Inherited from ​
id ​
id:
string
Defined In ​
packages/store/dist/schema/base.d.ts:105
Inherited from ​
keys ​
keys:
string
[]
Defined In ​
packages/store/dist/schema/base.d.ts:107
Inherited from ​
page ​
page:
Page
Defined In ​
packages/store/dist/schema/base.d.ts:104
Inherited from ​
propsUpdated ​
propsUpdated:
Slot
< {newProps
:unknown
;oldProps
:unknown
;} >
Defined In ​
packages/store/dist/schema/base.d.ts:111
Inherited from ​
role ​
role:
"root"
|"hub"
|"content"
Defined In ​
packages/store/dist/schema/base.d.ts:103
Inherited from ​
text ​
optional
text:Text
Defined In ​
packages/store/dist/schema/base.d.ts:108
Inherited from ​
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 ​
Methods ​
addColumn ​
addColumn(
position
,column
):string
Parameters ​
Parameter | Type |
---|---|
position | InsertToPosition |
column | Omit < 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 ​
Parameter | Type |
---|---|
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 ​
Inherited from ​
Defined In ​
packages/store/dist/schema/base.d.ts:124
copyCellsByColumn ​
copyCellsByColumn(
fromId
,toId
):void
Parameters ​
Parameter | Type |
---|---|
fromId | string |
toId | string |
Returns ​
void
Defined In ​
packages/blocks/src/database-block/database-model.ts:242
deleteColumn ​
deleteColumn(
columnId
):void
Parameters ​
Parameter | Type |
---|---|
columnId | string |
Returns ​
void
Defined In ​
packages/blocks/src/database-block/database-model.ts:203
deleteView ​
deleteView(
id
):void
Parameters ​
Parameter | Type |
---|---|
id | string |
Returns ​
void
Defined In ​
packages/blocks/src/database-block/database-model.ts:115
dispose ​
dispose():
void
Returns ​
void
Inherited from ​
Defined In ​
packages/store/dist/schema/base.d.ts:123
duplicateView ​
duplicateView(
id
):string
Parameters ​
Parameter | Type |
---|---|
id | string |
Returns ​
string
Defined In ​
packages/blocks/src/database-block/database-model.ts:99
findColumnIndex ​
findColumnIndex(
id
):number
Parameters ​
Parameter | Type |
---|---|
id | string |
Returns ​
number
Defined In ​
packages/blocks/src/database-block/database-model.ts:159
firstChild ​
firstChild():
null
|BaseBlockModel
<object
>
Returns ​
null
| BaseBlockModel
< object
>
Inherited from ​
Defined In ​
packages/store/dist/schema/base.d.ts:119
firstItem ​
firstItem():
null
|BaseBlockModel
<object
>
Returns ​
null
| BaseBlockModel
< object
>
Inherited from ​
Defined In ​
packages/store/dist/schema/base.d.ts:121
getCell ​
getCell(
rowId
,columnId
):null
|Cell
Parameters ​
Parameter | Type |
---|---|
rowId | string |
columnId | string |
Returns ​
null
| Cell
Defined In ​
packages/blocks/src/database-block/database-model.ts:212
getColumn ​
getColumn(
id
):undefined
|Column
<Record
<string
,unknown
> >
Parameters ​
Parameter | Type |
---|---|
id | string |
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 ​
Parameter | Type |
---|---|
viewType | "table" | "kanban" |
Returns ​
void
Defined In ​
packages/blocks/src/database-block/database-model.ts:42
initEmpty ​
initEmpty(
viewType
):void
Parameters ​
Parameter | Type |
---|---|
viewType | "table" | "kanban" |
Returns ​
void
Defined In ​
packages/blocks/src/database-block/database-model.ts:34
initTemplate ​
initTemplate(
viewType
):void
Parameters ​
Parameter | Type |
---|---|
viewType | "table" | "kanban" |
Returns ​
void
Defined In ​
packages/blocks/src/database-block/database-model.ts:50
isEmpty ​
isEmpty():
boolean
Returns ​
boolean
Inherited from ​
Defined In ​
packages/store/dist/schema/base.d.ts:118
lastChild ​
lastChild():
null
|BaseBlockModel
<object
>
Returns ​
null
| BaseBlockModel
< object
>
Inherited from ​
Defined In ​
packages/store/dist/schema/base.d.ts:120
lastItem ​
lastItem():
null
|BaseBlockModel
<object
>
Returns ​
null
| BaseBlockModel
< object
>
Inherited from ​
Defined In ​
packages/store/dist/schema/base.d.ts:122
moveViewTo ​
moveViewTo(
id
,position
):void
Parameters ​
Parameter | Type |
---|---|
id | string |
position | InsertToPosition |
Returns ​
void
Defined In ​
packages/blocks/src/database-block/database-model.ts:136
updateCell ​
updateCell(
rowId
,cell
):void
Parameters ​
Parameter | Type |
---|---|
rowId | string |
cell | Cell |
Returns ​
void
Defined In ​
packages/blocks/src/database-block/database-model.ts:229
updateCells ​
updateCells(
columnId
,cells
):void
Parameters ​
Parameter | Type |
---|---|
columnId | string |
cells | Record < string , unknown > |
Returns ​
void
Defined In ​
packages/blocks/src/database-block/database-model.ts:256
updateColumn ​
updateColumn(
id
,updater
):undefined
|string
Parameters ​
Parameter | Type |
---|---|
id | string |
updater | ColumnUpdater |
Returns ​
undefined
| string
Defined In ​
packages/blocks/src/database-block/database-model.ts:191
updateView ​
updateView(
id
,update
):void
Parameters ​
Parameter | Type |
---|---|
id | string |
update | function |
Returns ​
void
Defined In ​
packages/blocks/src/database-block/database-model.ts:122