mirror of
https://github.com/lancedb/lancedb.git
synced 2026-10-02 09:55:44 +00:00
A view is a named query a database stores and plans on every read. It
holds no rows, which is the whole difference from a materialized view.
## API
| Verb | Route |
| --- | --- |
| `create_view(name, query, namespace_path)` | `POST
/v1/view/{id}/create` |
| `describe_view(name, namespace_path)` | `POST /v1/view/{id}/describe`
|
| `drop_view(name, namespace_path)` | `POST /v1/view/{id}/drop` |
| `list_views(namespace_path)` | `GET /v1/namespace/{id}/view/list` |
On `Connection` and the `Database` trait, with the remote client, Python
(sync and async) and Node bindings. Local databases return
`NotSupported`: the server side is Sophon's, where a view is an object
of the database manifest.
`ViewDescription` carries the defining query, the database *and
namespace path* unqualified names in it resolve against, and the schema
the query resolved to. `create_view` returns one, so a caller has the
schema without a second call.
Both defaults travel with the view because it outlives the session that
declared it: the server re-plans the stored query on every read, so a
reader resolving an unqualified name against its own defaults would read
a different table. `default_namespace_path` crosses the wire as
`default_namespace`, a path like `namespace`, absent for the root.
There is no replace: a name already taken is an error, and changing a
view is a drop followed by a create, each authorized against what it
actually touches.
Querying a view stays SQL's job. There are no rows behind a view, so
there is no `open_view` returning a `Table`.
8.0 KiB
8.0 KiB
@lancedb/lancedb • Docs
@lancedb/lancedb
Namespaces
Enumerations
Classes
- AutoQuery
- BlobFile
- BooleanQuery
- BoostQuery
- BranchContents
- Branches
- Catalog
- Connection
- HeaderProvider
- Index
- Job
- MakeArrowTableOptions
- MatchQuery
- MaterializedView
- MergeInsertBuilder
- MultiMatchQuery
- NativeJsHeaderProvider
- OAuthHeaderProvider
- OAuthSession
- PermutationBuilder
- PhraseQuery
- Query
- QueryBase
- Scannable
- Session
- StaticHeaderProvider
- Table
- TagContents
- Tags
- TakeQuery
- VectorColumnOptions
- VectorQuery
Interfaces
- AddColumnsResult
- AddColumnsSql
- AddDataOptions
- AddResult
- AlterColumnsResult
- BranchColumnChange
- BranchColumnSummary
- BranchDiff
- BranchIndexSummary
- BranchRowCountSummary
- BucketStats
- CatalogOptions
- CherryPickError
- CherryPickPreview
- CherryPickResult
- ClientConfig
- ColumnAlteration
- ColumnOrdering
- CompactionStats
- ConnectNamespaceOptions
- ConnectionOptions
- CreateNamespaceOptions
- CreateNamespaceResponse
- CreateTableOptions
- DeleteResult
- DescribeNamespaceResponse
- DirNamespaceConfig
- DropColumnsResult
- DropNamespaceOptions
- DropNamespaceResponse
- ExecutableQuery
- FieldMetadataUpdate
- FragmentStatistics
- FragmentSummaryStats
- FtsOptions
- FtsToken
- FullTextQuery
- FullTextSearchOptions
- FunctionErrorFragment
- FunctionErrorRecord
- FunctionErrors
- FunctionErrorsOptions
- GenerationStats
- HnswPqOptions
- HnswSqOptions
- IndexConfig
- IndexOptions
- IndexStatistics
- IvfFlatOptions
- IvfPqOptions
- IvfRqOptions
- JobEventsOptions
- JobFailureInfo
- JobInfo
- ListDatabasesResponse
- ListNamespacesOptions
- ListNamespacesResponse
- ListTablesOptions
- ListTablesResponse
- LsmStats
- LsmWriteSpec
- MaterializedViewDefinition
- MemtableStats
- MergeResult
- NativeOAuthConfig
- OAuthConfig
- OpenTableOptions
- OptimizeOptions
- OptimizeStats
- QueryExecutionOptions
- RefreshColumnResult
- RefreshMaterializedViewResult
- RemovalStats
- RenameTableOptions
- RestNamespaceConfig
- RetryConfig
- ScannableOptions
- SessionLogout
- SessionStatus
- ShuffleOptions
- SplitCalculatedOptions
- SplitHashOptions
- SplitRandomOptions
- SplitSequentialOptions
- TableNamesOptions
- TableStatistics
- TimeoutConfig
- TlsConfig
- TokenCacheOptions
- TokenResponse
- TokenizeOptions
- UpdateFieldMetadataResult
- UpdateOptions
- UpdateResult
- Version
- ViewDescription
- WriteExecutionOptions
- WriteProgress
Type Aliases
- AnalyzePlanDistributedMetrics
- BaseTokenizer
- BlobOptions
- Data
- DataLike
- FieldLike
- IntoSql
- IntoVector
- MaterializedViewSelect
- MultiVector
- RecordBatchLike
- SchemaLike
- TableLike
- TokenizeTableOptions