5.9 KiB
vectordb / Exports / LocalTable
Class: LocalTable<T>
A LanceDB Table is the collection of Records. Each Record has one or more vector fields.
Type parameters
| Name | Type |
|---|---|
T |
number[] |
Implements
Table<T>
Table of contents
Constructors
Properties
Accessors
Methods
Constructors
constructor
• new LocalTable<T>(tbl, name, options)
Type parameters
| Name | Type |
|---|---|
T |
number[] |
Parameters
| Name | Type |
|---|---|
tbl |
any |
name |
string |
options |
ConnectionOptions |
Defined in
• new LocalTable<T>(tbl, name, options, embeddings)
Type parameters
| Name | Type |
|---|---|
T |
number[] |
Parameters
| Name | Type | Description |
|---|---|---|
tbl |
any |
|
name |
string |
|
options |
ConnectionOptions |
|
embeddings |
EmbeddingFunction<T> |
An embedding function to use when interacting with this table |
Defined in
Properties
_embeddings
• Private Optional Readonly _embeddings: EmbeddingFunction<T>
Defined in
_name
• Private Readonly _name: string
Defined in
_options
• Private Readonly _options: ConnectionOptions
Defined in
_tbl
• Private Readonly _tbl: any
Defined in
Accessors
name
• get name(): string
Returns
string
Implementation of
Defined in
Methods
add
▸ add(data): Promise<number>
Insert records into this Table.
Parameters
| Name | Type | Description |
|---|---|---|
data |
Record<string, unknown>[] |
Records to be inserted into the Table |
Returns
Promise<number>
The number of rows added to the table
Implementation of
Defined in
countRows
▸ countRows(): Promise<number>
Returns the number of rows in this table.
Returns
Promise<number>
Implementation of
Defined in
createIndex
▸ createIndex(indexParams): Promise<any>
Create an ANN index on this Table vector index.
See
VectorIndexParams.
Parameters
| Name | Type | Description |
|---|---|---|
indexParams |
IvfPQIndexConfig |
The parameters of this Index, |
Returns
Promise<any>
Implementation of
Defined in
delete
▸ delete(filter): Promise<void>
Delete rows from this table.
Parameters
| Name | Type | Description |
|---|---|---|
filter |
string |
A filter in the same format used by a sql WHERE clause. |
Returns
Promise<void>
Implementation of
Defined in
overwrite
▸ overwrite(data): Promise<number>
Insert records into this Table, replacing its contents.
Parameters
| Name | Type | Description |
|---|---|---|
data |
Record<string, unknown>[] |
Records to be inserted into the Table |
Returns
Promise<number>
The number of rows added to the table
Implementation of
Defined in
search
▸ search(query): Query<T>
Creates a search query to find the nearest neighbors of the given search term
Parameters
| Name | Type | Description |
|---|---|---|
query |
T |
The query search term |
Returns
Query<T>