Files
lancedb/docs/src/javascript/classes/LocalConnection.md
2023-07-18 08:19:48 -07:00

7.6 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:184

Properties

_db

Private Readonly _db: any

Defined in

index.ts:182


_options

Private Readonly _options: ConnectionOptions

Defined in

index.ts:181

Accessors

uri

get uri(): string

Returns

string

Implementation of

Connection.uri

Defined in

index.ts:189

Methods

createTable

createTable(name, data, mode?): 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 Record<string, unknown>[] Non-empty Array of Records to be inserted into the Table
mode? WriteMode The write mode to use when creating the table.

Returns

Promise<Table<number[]>>

Implementation of

Connection.createTable

Defined in

index.ts:230

createTable(name, data, mode): Promise<Table<number[]>>

Parameters

Name Type
name string
data Record<string, unknown>[]
mode WriteMode

Returns

Promise<Table<number[]>>

Implementation of

Connection.createTable

Defined in

index.ts:231

createTable<T>(name, data, mode, 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 Record<string, unknown>[] Non-empty Array of Records to be inserted into the Table
mode WriteMode The write mode to use when creating the table.
embeddings EmbeddingFunction<T> An embedding function to use on this Table

Returns

Promise<Table<T>>

Implementation of

Connection.createTable

Defined in

index.ts:241

createTable<T>(name, data, mode, embeddings?): Promise<Table<T>>

Type parameters

Name
T

Parameters

Name Type
name string
data Record<string, unknown>[]
mode WriteMode
embeddings? EmbeddingFunction<T>

Returns

Promise<Table<T>>

Implementation of

Connection.createTable

Defined in

index.ts:242


createTableArrow

createTableArrow(name, table): Promise<Table<number[]>>

Parameters

Name Type
name string
table Table<any>

Returns

Promise<Table<number[]>>

Implementation of

Connection.createTableArrow

Defined in

index.ts:266


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


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

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

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


tableNames

tableNames(): Promise<string[]>

Get the names of all tables in the database.

Returns

Promise<string[]>

Implementation of

Connection.tableNames

Defined in

index.ts:196