[**@lancedb/lancedb**](../README.md) • **Docs** *** [@lancedb/lancedb](../globals.md) / MaterializedView # Class: MaterializedView A handle on a materialized view: its table plus its definition. Obtained from [Connection#createMaterializedView](Connection.md#creatematerializedview) or [Connection#openMaterializedView](Connection.md#openmaterializedview). The view is a normal table -- queries, indexes and search all apply through [MaterializedView#table](MaterializedView.md#table) -- whose contents are maintained by [MaterializedView#refresh](MaterializedView.md#refresh). ## Constructors ### new MaterializedView() ```ts new MaterializedView(table): MaterializedView ``` #### Parameters * **table**: [`Table`](Table.md) #### Returns [`MaterializedView`](MaterializedView.md) ## Accessors ### name ```ts get name(): string ``` #### Returns `string` ## Methods ### definition() ```ts definition(): Promise ``` The query that defines the view. #### Returns `Promise`<[`MaterializedViewDefinition`](../interfaces/MaterializedViewDefinition.md)> *** ### refresh() ```ts refresh(options?): Promise ``` Recompute the view from its source. Every refresh rebuilds the complete view. For local views, `sourceVersion` refreshes to that source version instead of the latest; remote SQL refreshes do not support source-version pinning. #### Parameters * **options?** * **options.sourceVersion?**: `number` #### Returns `Promise`<[`RefreshMaterializedViewResult`](../interfaces/RefreshMaterializedViewResult.md)> *** ### table() ```ts table(): Table ``` The view, as the table it is. #### Returns [`Table`](Table.md)