Elffuss BraidHub

kikocis/lancedb public

main · 6.9 KiBSourceRawPermalink

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

NameType
dbany
optionsConnectionOptions

Defined in

index.ts:739

Properties

_db

• Private Readonly _db: any

Defined in

index.ts:737


_options

• Private Readonly _options: () => ConnectionOptions

Type declaration

▸ (): ConnectionOptions

Returns

ConnectionOptions

Defined in

index.ts:736

Accessors

uri

• get uri(): string

Returns

string

Implementation of

Connection.uri

Defined in

index.ts:744

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

NameType
namestring | CreateTableOptions<T>
data?Table<any> | Record<string, unknown>[]
optsOrEmbedding?WriteOptions | EmbeddingFunction<T>
opt?WriteOptions

Returns

Promise<Table<T>>

Implementation of

Connection.createTable

Defined in

index.ts:788


createTableImpl

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

Type parameters

Name
T

Parameters

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

Returns

Promise<Table<T>>

Defined in

index.ts:822


dropTable

▸ dropTable(name): Promise<void>

Drop an existing table.

Parameters

NameTypeDescription
namestringThe name of the table to drop.

Returns

Promise<void>

Implementation of

Connection.dropTable

Defined in

index.ts:876


openTable

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

Open a table in the database.

Parameters

NameTypeDescription
namestringThe name of the table.

Returns

Promise<Table<number[]>>

Implementation of

Connection.openTable

Defined in

index.ts:760

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

Open a table in the database.

Type parameters

Name
T

Parameters

NameTypeDescription
namestringThe name of the table.
embeddingsEmbeddingFunction<T>An embedding function to use on this Table

Returns

Promise<Table<T>>

Implementation of

Connection.openTable

Defined in

index.ts:768

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

Type parameters

Name
T

Parameters

NameType
namestring
embeddings?EmbeddingFunction<T>

Returns

Promise<Table<T>>

Implementation of

Connection.openTable

Defined in

index.ts:772


tableNames

▸ tableNames(): Promise<string[]>

Get the names of all tables in the database.

Returns

Promise<string[]>

Implementation of

Connection.tableNames

Defined in

index.ts:751


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

NameType
middlewareHttpMiddleware

Returns

Connection

Implementation of

Connection.withMiddleware

Defined in

index.ts:880