Skip to content

BlockSuite API Documentation / @blocksuite/blocks / DatabaseBlockDataSource

Class: DatabaseBlockDataSource

Extends

  • DataSourceBase

Constructors

new DatabaseBlockDataSource()

new DatabaseBlockDataSource(model): DatabaseBlockDataSource

Parameters

model: DatabaseBlockModel

Returns

DatabaseBlockDataSource

Overrides

DataSourceBase.constructor

Defined in

packages/blocks/src/database-block/data-source.ts:100

Properties

context

context: Map<DataViewContextKey<unknown>, unknown>

Inherited from

DataSourceBase.context

Defined in

packages/affine/data-view/dist/core/common/data-source/base.d.ts:48


featureFlags$

featureFlags$: ReadonlySignal<DatabaseFlags>

Overrides

DataSourceBase.featureFlags$

Defined in

packages/blocks/src/database-block/data-source.ts:59


properties$

properties$: ReadonlySignal<string[]>

Overrides

DataSourceBase.properties$

Defined in

packages/blocks/src/database-block/data-source.ts:67


readonly$

readonly$: ReadonlySignal<boolean>

Overrides

DataSourceBase.readonly$

Defined in

packages/blocks/src/database-block/data-source.ts:71


rows$

rows$: ReadonlySignal<string[]>

Overrides

DataSourceBase.rows$

Defined in

packages/blocks/src/database-block/data-source.ts:77


viewConverts

viewConverts: ViewConvertConfig[] = databaseBlockViewConverts

Overrides

DataSourceBase.viewConverts

Defined in

packages/blocks/src/database-block/data-source.ts:81


viewDataList$

viewDataList$: ReadonlySignal<DefaultViewDataType[]>

Overrides

DataSourceBase.viewDataList$

Defined in

packages/blocks/src/database-block/data-source.ts:83


viewManager

viewManager: ViewManager

Overrides

DataSourceBase.viewManager

Defined in

packages/blocks/src/database-block/data-source.ts:87


viewMetas

viewMetas: ViewMeta[] = databaseBlockViews

Overrides

DataSourceBase.viewMetas

Defined in

packages/blocks/src/database-block/data-source.ts:89

Accessors

doc

get doc(): Doc

Returns

Doc

Defined in

packages/blocks/src/database-block/data-source.ts:91


propertyMetas

get propertyMetas(): PropertyMetaConfig<any, any, any>[]

Returns

PropertyMetaConfig<any, any, any>[]

Overrides

DataSourceBase.propertyMetas

Defined in

packages/blocks/src/database-block/data-source.ts:96

Methods

cellValueChange()

cellValueChange(rowId, propertyId, value): void

Parameters

rowId: string

propertyId: string

value: unknown

Returns

void

Overrides

DataSourceBase.cellValueChange

Defined in

packages/blocks/src/database-block/data-source.ts:130


cellValueGet()

cellValueGet(rowId, propertyId): unknown

Parameters

rowId: string

propertyId: string

Returns

unknown

Overrides

DataSourceBase.cellValueGet

Defined in

packages/blocks/src/database-block/data-source.ts:156


contextGet()

contextGet<T>(key): undefined | T

Type Parameters

T

Parameters

key: DataViewContextKey<T>

Returns

undefined | T

Inherited from

DataSourceBase.contextGet

Defined in

packages/affine/data-view/dist/core/common/data-source/base.d.ts:61


contextSet()

contextSet<T>(key, value): void

Type Parameters

T

Parameters

key: DataViewContextKey<T>

value: T

Returns

void

Inherited from

DataSourceBase.contextSet

Defined in

packages/affine/data-view/dist/core/common/data-source/base.d.ts:62


propertyAdd()

propertyAdd(insertToPosition, type?): string

Parameters

insertToPosition: InsertToPosition

type?: string

Returns

string

Overrides

DataSourceBase.propertyAdd

Defined in

packages/blocks/src/database-block/data-source.ts:172


propertyDataGet()

propertyDataGet(propertyId): Record<string, unknown>

Parameters

propertyId: string

Returns

Record<string, unknown>

Overrides

DataSourceBase.propertyDataGet

Defined in

packages/blocks/src/database-block/data-source.ts:185


propertyDataSet()

propertyDataSet(propertyId, data): void

Parameters

propertyId: string

data: Record<string, unknown>

Returns

void

Overrides

DataSourceBase.propertyDataSet

Defined in

packages/blocks/src/database-block/data-source.ts:191


propertyDataTypeGet()

propertyDataTypeGet(propertyId): undefined | TType

Parameters

propertyId: string

Returns

undefined | TType

Overrides

DataSourceBase.propertyDataTypeGet

Defined in

packages/blocks/src/database-block/data-source.ts:198


propertyDelete()

propertyDelete(id): void

Parameters

id: string

Returns

void

Overrides

DataSourceBase.propertyDelete

Defined in

packages/blocks/src/database-block/data-source.ts:207


propertyDuplicate()

propertyDuplicate(propertyId): string

Parameters

propertyId: string

Returns

string

Overrides

DataSourceBase.propertyDuplicate

Defined in

packages/blocks/src/database-block/data-source.ts:217


propertyMetaGet()

propertyMetaGet(type): PropertyMetaConfig

Parameters

type: string

Returns

PropertyMetaConfig

Overrides

DataSourceBase.propertyMetaGet

Defined in

packages/blocks/src/database-block/data-source.ts:241


propertyNameGet()

propertyNameGet(propertyId): string

Parameters

propertyId: string

Returns

string

Overrides

DataSourceBase.propertyNameGet

Defined in

packages/blocks/src/database-block/data-source.ts:245


propertyNameSet()

propertyNameSet(propertyId, name): void

Parameters

propertyId: string

name: string

Returns

void

Overrides

DataSourceBase.propertyNameSet

Defined in

packages/blocks/src/database-block/data-source.ts:254


propertyReadonlyGet()

propertyReadonlyGet(propertyId): boolean

Parameters

propertyId: string

Returns

boolean

Overrides

DataSourceBase.propertyReadonlyGet

Defined in

packages/blocks/src/database-block/data-source.ts:260


propertyTypeGet()

propertyTypeGet(propertyId): string

Parameters

propertyId: string

Returns

string

Overrides

DataSourceBase.propertyTypeGet

Defined in

packages/blocks/src/database-block/data-source.ts:265


propertyTypeSet()

propertyTypeSet(propertyId, toType): void

Parameters

propertyId: string

toType: string

Returns

void

Overrides

DataSourceBase.propertyTypeSet

Defined in

packages/blocks/src/database-block/data-source.ts:274


rowAdd()

rowAdd(insertPosition): string

Parameters

insertPosition: number | InsertToPosition

Returns

string

Overrides

DataSourceBase.rowAdd

Defined in

packages/blocks/src/database-block/data-source.ts:308


rowDelete()

rowDelete(ids): void

Parameters

ids: string[]

Returns

void

Overrides

DataSourceBase.rowDelete

Defined in

packages/blocks/src/database-block/data-source.ts:317


rowMove()

rowMove(rowId, position): void

Parameters

rowId: string

position: InsertToPosition

Returns

void

Overrides

DataSourceBase.rowMove

Defined in

packages/blocks/src/database-block/data-source.ts:325


viewDataAdd()

viewDataAdd(viewData): string

Parameters

viewData: DefaultViewDataType

Returns

string

Overrides

DataSourceBase.viewDataAdd

Defined in

packages/blocks/src/database-block/data-source.ts:337


viewDataDelete()

viewDataDelete(viewId): void

Parameters

viewId: string

Returns

void

Overrides

DataSourceBase.viewDataDelete

Defined in

packages/blocks/src/database-block/data-source.ts:345


viewDataDuplicate()

viewDataDuplicate(id): string

Parameters

id: string

Returns

string

Overrides

DataSourceBase.viewDataDuplicate

Defined in

packages/blocks/src/database-block/data-source.ts:350


viewDataGet()

viewDataGet(viewId): DefaultViewDataType

Parameters

viewId: string

Returns

DefaultViewDataType

Overrides

DataSourceBase.viewDataGet

Defined in

packages/blocks/src/database-block/data-source.ts:354


viewDataMoveTo()

viewDataMoveTo(id, position): void

Parameters

id: string

position: InsertToPosition

Returns

void

Overrides

DataSourceBase.viewDataMoveTo

Defined in

packages/blocks/src/database-block/data-source.ts:358


viewDataUpdate()

viewDataUpdate<ViewData>(id, updater): void

Type Parameters

ViewData extends DefaultViewDataType

Parameters

id: string

updater

Returns

void

Overrides

DataSourceBase.viewDataUpdate

Defined in

packages/blocks/src/database-block/data-source.ts:362


viewMetaGet()

viewMetaGet(type): ViewMeta

Parameters

type: string

Returns

ViewMeta

Overrides

DataSourceBase.viewMetaGet

Defined in

packages/blocks/src/database-block/data-source.ts:369


viewMetaGetById()

viewMetaGetById(viewId): ViewMeta

Parameters

viewId: string

Returns

ViewMeta

Overrides

DataSourceBase.viewMetaGetById

Defined in

packages/blocks/src/database-block/data-source.ts:373