Skip to content

@lancedb/lancedb • Docs


@lancedb/lancedb / MaterializedView

Class: MaterializedView

A handle on a materialized view: its table plus its definition.

Obtained from Connection#createMaterializedView or Connection#openMaterializedView. The view is a normal table -- queries, indexes and search all apply through MaterializedView#table -- whose contents are maintained by MaterializedView#refresh.

Constructors

new MaterializedView()

new MaterializedView(table): MaterializedView

Parameters

Returns

MaterializedView

Accessors

name

get name(): string

Returns

string

Methods

definition()

definition(): Promise<MaterializedViewDefinition>

The query that defines the view.

Returns

Promise<MaterializedViewDefinition>


refresh()

refresh(options?): Promise<RefreshMaterializedViewResult>

Recompute the view from its source. Local refresh requires a source build with experimental-functions.

full: true forces a remote rebuild; otherwise the server chooses the refresh mode. Local views always rebuild, and sourceVersion selects a source version instead of the latest. Remote SQL refreshes do not support source-version pinning. Their results leave mode, rowsWritten, and sourceVersion absent because the SQL job adapter does not expose these metrics.

Parameters

  • options?

  • options.full?: boolean

  • options.sourceVersion?: number

Returns

Promise<RefreshMaterializedViewResult>


table()

table(): Table

The view, as the table it is.

Returns

Table