接口:连接
一个LanceDB连接,允许您打开表并创建新表。
连接可以是针对本地文件系统的,也可以是针对远程服务器的。
由实现
目录
属性
方法
属性
uri
• uri: string
定义于
方法
createTable
▸ createTable\<T>(«destructured»): Promise\<Table\<T>>
创建一个新表,可选择用新数据初始化它。
类型参数
| 名称 |
|---|
T |
参数
| 名称 | 类型 |
|---|---|
«destructured» |
CreateTableOptions\<T> |
返回值
Promise\<Table\<T>>
定义于
▸ createTable(name, data): Promise\<Table\<number[]>>
创建一个新表并用新数据初始化它。
参数
| 名称 | 类型 | 描述 |
|---|---|---|
name |
string |
The name of the table. |
data |
Table\<any> | Record\<string, unknown>[] |
Non-empty Array of Records to be inserted into the table |
返回值
Promise\<Table\<number[]>>
定义于
▸ createTable(name, data, options): Promise\<Table\<number[]>>
创建一个新表并用新数据初始化它。
参数
| 名称 | 类型 | 描述 |
|---|---|---|
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. |
返回值
Promise\<Table\<number[]>>
定义于
▸ createTable\<T>(name, data, embeddings): Promise\<Table\<T>>
创建一个新表并用新数据初始化它。
类型参数
| 名称 |
|---|
T |
参数
| 名称 | 类型 | 描述 |
|---|---|---|
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 |
返回值
Promise\<Table\<T>>
定义于
▸ createTable\<T>(name, data, embeddings, options): Promise\<Table\<T>>
创建一个新表并用新数据初始化它。
类型参数
| 名称 |
|---|
T |
参数
| 名称 | 类型 | 描述 |
|---|---|---|
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. |
返回值
Promise\<Table\<T>>
定义于
dropTable
▸ dropTable(name): Promise\<void>
删除现有表。
参数
| 名称 | 类型 | 描述 |
|---|---|---|
name |
string |
The name of the table to drop. |
返回值
Promise\<void>
定义于
openTable
▸ openTable\<T>(name, embeddings?): Promise\<Table\<T>>
在数据库中打开一个表。
类型参数
| 名称 |
|---|
T |
参数
| 名称 | 类型 | 描述 |
|---|---|---|
name |
string |
The name of the table. |
embeddings? |
EmbeddingFunction\<T> |
An embedding function to use on this table |
返回值
Promise\<Table\<T>>
定义于
表名
▸ tableNames(): Promise\<string[]>
返回值
Promise\<string[]>
定义于
withMiddleware
▸ withMiddleware(middleware): Connection
通过中间件来监控此连接的行为。
中间件将按照它们被添加的顺序依次调用。
目前此功能仅支持远程连接。
参数
| 名称 | 类型 |
|---|---|
middleware |
HttpMiddleware |
返回值
- 这个连接由传入的中间件进行检测