vectordb / Exports / Connection
Interface: Connection
A LanceDB Connection that allows you to open tables and create new ones.
Connection could be local against filesystem or remote against a server.
Implemented by
Table of contents
Properties
Methods
Properties
uri
โข uri: string
Defined in
Methods
createTable
โธ createTable\<T
>(ยซdestructuredยป
): Promise
\<Table
\<T
>>
Creates a new Table, optionally initializing it with new data.
Type parameters
Name |
---|
T |
Parameters
Name | Type |
---|---|
ยซdestructuredยป |
CreateTableOptions \<T > |
Returns
Promise
\<Table
\<T
>>
Defined in
โธ createTable(name
, data
): Promise
\<Table
\<number
[]>>
Creates a new Table and initialize it with new data.
Parameters
Name | Type | Description |
---|---|---|
name |
string |
The name of the table. |
data |
Table \<any > | Record \<string , unknown >[] |
Non-empty Array of Records to be inserted into the table |
Returns
Promise
\<Table
\<number
[]>>
Defined in
โธ createTable(name
, data
, options
): Promise
\<Table
\<number
[]>>
Creates a new Table and initialize it with new data.
Parameters
Name | Type | Description |
---|---|---|
name |
string |
The name of the table. |
data |
Table \<any > | Record \<string , unknown >[] |
Non-empty Array of Records to be inserted into the table |
options |
WriteOptions |
The write options to use when creating the table. |
Returns
Promise
\<Table
\<number
[]>>
Defined in
โธ createTable\<T
>(name
, data
, embeddings
): Promise
\<Table
\<T
>>
Creates a new Table and initialize it with new data.
Type parameters
Name |
---|
T |
Parameters
Name | Type | Description |
---|---|---|
name |
string |
The name of the table. |
data |
Table \<any > | Record \<string , unknown >[] |
Non-empty Array of Records to be inserted into the table |
embeddings |
EmbeddingFunction \<T > |
An embedding function to use on this table |
Returns
Promise
\<Table
\<T
>>
Defined in
โธ createTable\<T
>(name
, data
, embeddings
, options
): Promise
\<Table
\<T
>>
Creates a new Table and initialize it with new data.
Type parameters
Name |
---|
T |
Parameters
Name | Type | Description |
---|---|---|
name |
string |
The name of the table. |
data |
Table \<any > | Record \<string , unknown >[] |
Non-empty Array of Records to be inserted into the table |
embeddings |
EmbeddingFunction \<T > |
An embedding function to use on this table |
options |
WriteOptions |
The write options to use when creating the table. |
Returns
Promise
\<Table
\<T
>>
Defined in
dropTable
โธ dropTable(name
): Promise
\<void
>
Drop an existing table.
Parameters
Name | Type | Description |
---|---|---|
name |
string |
The name of the table to drop. |
Returns
Promise
\<void
>
Defined in
openTable
โธ openTable\<T
>(name
, embeddings?
): Promise
\<Table
\<T
>>
Open a table in the database.
Type parameters
Name |
---|
T |
Parameters
Name | Type | Description |
---|---|---|
name |
string |
The name of the table. |
embeddings? |
EmbeddingFunction \<T > |
An embedding function to use on this table |
Returns
Promise
\<Table
\<T
>>
Defined in
tableNames
โธ tableNames(): Promise
\<string
[]>
Returns
Promise
\<string
[]>
Defined in
withMiddleware
โธ withMiddleware(middleware
): Connection
Instrument the behavior of this Connection with middleware.
The middleware will be called in the order they are added.
Currently this functionality is only supported for remote Connections.
Parameters
Name | Type |
---|---|
middleware |
HttpMiddleware |
Returns
- this Connection instrumented by the passed middleware