Files
lancedb/docs/src/javascript/classes/LocalConnection.md
Lei Xu 5b2c602fb3 doc: improve docs for nodejs connect functions (#833)
* improve the docstring for NodeJS connect functions and
`ConnectOptions` parameters.
* Simplify `npm run build` steps.
2024-04-05 16:27:32 -07:00

6.1 KiB

vectordb / Exports / LocalConnection

Class: LocalConnection

A connection to a LanceDB database.

Implements

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new LocalConnection(db, options)

Parameters

Name Type
db any
options ConnectionOptions

Defined in

index.ts:489

Properties

_db

Private Readonly _db: any

Defined in

index.ts:487


_options

Private Readonly _options: () => ConnectionOptions

Type declaration

▸ (): ConnectionOptions

Returns

ConnectionOptions

Defined in

index.ts:486

Accessors

uri

get uri(): string

Returns

string

Implementation of

Connection.uri

Defined in

index.ts:494

Methods

createTable

createTable<T>(name, data?, optsOrEmbedding?, opt?): Promise<Table<T>>

Creates a new Table, optionally initializing it with new data.

Type parameters

Name
T

Parameters

Name Type
name string | CreateTableOptions<T>
data? Record<string, unknown>[]
optsOrEmbedding? WriteOptions | EmbeddingFunction<T>
opt? WriteOptions

Returns

Promise<Table<T>>

Implementation of

Connection.createTable

Defined in

index.ts:542


createTableImpl

Private createTableImpl<T>(«destructured»): Promise<Table<T>>

Type parameters

Name
T

Parameters

Name Type
«destructured» Object
› data? Table<any> | Record<string, unknown>[]
› embeddingFunction? EmbeddingFunction<T>
› name string
› schema? Schema<any>
› writeOptions? WriteOptions

Returns

Promise<Table<T>>

Defined in

index.ts:576


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>

Implementation of

Connection.dropTable

Defined in

index.ts:630


openTable

openTable(name): Promise<Table<number[]>>

Open a table in the database.

Parameters

Name Type Description
name string The name of the table.

Returns

Promise<Table<number[]>>

Implementation of

Connection.openTable

Defined in

index.ts:510

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>>

Implementation of

Connection.openTable

Defined in

index.ts:518

openTable<T>(name, embeddings?): Promise<Table<T>>

Type parameters

Name
T

Parameters

Name Type
name string
embeddings? EmbeddingFunction<T>

Returns

Promise<Table<T>>

Implementation of

Connection.openTable

Defined in

index.ts:522


tableNames

tableNames(): Promise<string[]>

Get the names of all tables in the database.

Returns

Promise<string[]>

Implementation of

Connection.tableNames

Defined in

index.ts:501