@lancedb/lancedb
Advanced tools
Comparing version 0.15.0 to 0.15.1-beta.2
"use strict"; | ||
// Copyright 2023 Lance Developers. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// SPDX-FileCopyrightText: Copyright The LanceDB Authors | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
@@ -502,2 +491,8 @@ if (k2 === undefined) k2 = k; | ||
} | ||
let schemaMetadata = schema?.metadata || new Map(); | ||
if (!(embeddings == null || embeddings === undefined)) { | ||
const registry = (0, registry_1.getRegistry)(); | ||
const embeddingMetadata = registry.getTableMetadata([embeddings]); | ||
schemaMetadata = new Map([...schemaMetadata, ...embeddingMetadata]); | ||
} | ||
// Convert from ArrowTable to Record<String, Vector> | ||
@@ -557,3 +552,3 @@ const colEntries = [...Array(table.numCols).keys()].map((_, idx) => { | ||
} | ||
const newTable = new apache_arrow_1.Table(newColumns); | ||
let newTable = new apache_arrow_1.Table(newColumns); | ||
if (schema != null) { | ||
@@ -563,4 +558,5 @@ if (schema.fields.find((f) => f.name === destColumn) === undefined) { | ||
} | ||
return alignTable(newTable, schema); | ||
newTable = alignTable(newTable, schema); | ||
} | ||
newTable = new apache_arrow_1.Table(new apache_arrow_1.Schema(newTable.schema.fields, schemaMetadata), newTable.batches); | ||
return newTable; | ||
@@ -567,0 +563,0 @@ } |
"use strict"; | ||
// Copyright 2024 Lance Developers. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// SPDX-FileCopyrightText: Copyright The LanceDB Authors | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -16,0 +5,0 @@ exports.LocalConnection = exports.Connection = void 0; |
"use strict"; | ||
// Copyright 2024 Lance Developers. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// SPDX-FileCopyrightText: Copyright The LanceDB Authors | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -16,0 +5,0 @@ exports.TextEmbeddingFunction = exports.EmbeddingFunction = void 0; |
"use strict"; | ||
// Copyright 2023 Lance Developers. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// SPDX-FileCopyrightText: Copyright The LanceDB Authors | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
@@ -16,0 +5,0 @@ if (k2 === undefined) k2 = k; |
"use strict"; | ||
// Copyright 2023 Lance Developers. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// SPDX-FileCopyrightText: Copyright The LanceDB Authors | ||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
@@ -16,0 +5,0 @@ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; |
"use strict"; | ||
// Copyright 2024 Lance Developers. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// SPDX-FileCopyrightText: Copyright The LanceDB Authors | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -16,0 +5,0 @@ exports.EmbeddingFunctionRegistry = void 0; |
"use strict"; | ||
// Copyright 2023 Lance Developers. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// SPDX-FileCopyrightText: Copyright The LanceDB Authors | ||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
@@ -16,0 +5,0 @@ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; |
"use strict"; | ||
// Copyright 2024 Lance Developers. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// SPDX-FileCopyrightText: Copyright The LanceDB Authors | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -16,0 +5,0 @@ exports.rerankers = exports.embedding = exports.Table = exports.Index = exports.RecordBatchIterator = exports.VectorQuery = exports.QueryBase = exports.Query = exports.Connection = exports.VectorColumnOptions = exports.MakeArrowTableOptions = exports.makeArrowTable = exports.WriteMode = void 0; |
"use strict"; | ||
// Copyright 2024 Lance Developers. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// SPDX-FileCopyrightText: Copyright The LanceDB Authors | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -16,0 +5,0 @@ exports.Index = void 0; |
@@ -1,2 +0,2 @@ | ||
import { Data } from "./arrow"; | ||
import { Data, Schema } from "./arrow"; | ||
import { NativeMergeInsertBuilder } from "./native"; | ||
@@ -7,3 +7,3 @@ /** A builder used to create and run a merge insert operation */ | ||
/** Construct a MergeInsertBuilder. __Internal use only.__ */ | ||
constructor(native: NativeMergeInsertBuilder); | ||
constructor(native: NativeMergeInsertBuilder, schema: Schema | Promise<Schema>); | ||
/** | ||
@@ -10,0 +10,0 @@ * Rows that exist in both the source table (new data) and |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.MergeInsertBuilder = void 0; | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// SPDX-FileCopyrightText: Copyright The LanceDB Authors | ||
const arrow_1 = require("./arrow"); | ||
@@ -8,5 +10,7 @@ /** A builder used to create and run a merge insert operation */ | ||
#native; | ||
#schema; | ||
/** Construct a MergeInsertBuilder. __Internal use only.__ */ | ||
constructor(native) { | ||
constructor(native, schema) { | ||
this.#native = native; | ||
this.#schema = schema; | ||
} | ||
@@ -36,3 +40,3 @@ /** | ||
whenMatchedUpdateAll(options) { | ||
return new MergeInsertBuilder(this.#native.whenMatchedUpdateAll(options?.where)); | ||
return new MergeInsertBuilder(this.#native.whenMatchedUpdateAll(options?.where), this.#schema); | ||
} | ||
@@ -44,3 +48,3 @@ /** | ||
whenNotMatchedInsertAll() { | ||
return new MergeInsertBuilder(this.#native.whenNotMatchedInsertAll()); | ||
return new MergeInsertBuilder(this.#native.whenNotMatchedInsertAll(), this.#schema); | ||
} | ||
@@ -55,3 +59,3 @@ /** | ||
whenNotMatchedBySourceDelete(options) { | ||
return new MergeInsertBuilder(this.#native.whenNotMatchedBySourceDelete(options?.where)); | ||
return new MergeInsertBuilder(this.#native.whenNotMatchedBySourceDelete(options?.where), this.#schema); | ||
} | ||
@@ -64,3 +68,11 @@ /** | ||
async execute(data) { | ||
const buffer = await (0, arrow_1.fromDataToBuffer)(data); | ||
let schema; | ||
if (this.#schema instanceof Promise) { | ||
schema = await this.#schema; | ||
this.#schema = schema; // In case of future calls | ||
} | ||
else { | ||
schema = this.#schema; | ||
} | ||
const buffer = await (0, arrow_1.fromDataToBuffer)(data, undefined, schema); | ||
await this.#native.execute(buffer); | ||
@@ -67,0 +79,0 @@ } |
@@ -348,2 +348,3 @@ /* tslint:disable */ | ||
createIndex(index: Index | undefined | null, column: string, replace?: boolean | undefined | null): Promise<void> | ||
dropIndex(indexName: string): Promise<void> | ||
update(onlyIf: string | undefined | null, columns: Array<[string, string]>): Promise<bigint> | ||
@@ -350,0 +351,0 @@ query(): Query |
"use strict"; | ||
// Copyright 2024 Lance Developers. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// SPDX-FileCopyrightText: Copyright The LanceDB Authors | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -16,0 +5,0 @@ exports.Query = exports.VectorQuery = exports.QueryBase = exports.RecordBatchIterator = void 0; |
"use strict"; | ||
// Copyright 2023 LanceDB Developers. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// SPDX-FileCopyrightText: Copyright The LanceDB Authors | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -16,0 +5,0 @@ exports.sanitizeMetadata = sanitizeMetadata; |
@@ -174,2 +174,13 @@ import { Table as ArrowTable, Data, IntoVector, Schema, TableLike } from "./arrow"; | ||
/** | ||
* Drop an index from the table. | ||
* | ||
* @param name The name of the index. | ||
* | ||
* @note This does not delete the index from disk, it just removes it from the table. | ||
* To delete the index, run {@link Table#optimize} after dropping the index. | ||
* | ||
* Use {@link Table.listIndices} to find the names of the indices. | ||
*/ | ||
abstract dropIndex(name: string): Promise<void>; | ||
/** | ||
* Create a {@link Query} Builder. | ||
@@ -363,2 +374,4 @@ * | ||
* @returns {IndexStatistics | undefined} The stats of the index. If the index does not exist, it will return undefined | ||
* | ||
* Use {@link Table.listIndices} to find the names of the indices. | ||
*/ | ||
@@ -390,2 +403,3 @@ abstract indexStats(name: string): Promise<IndexStatistics | undefined>; | ||
createIndex(column: string, options?: Partial<IndexOptions>): Promise<void>; | ||
dropIndex(name: string): Promise<void>; | ||
query(): Query; | ||
@@ -392,0 +406,0 @@ search(query: string | IntoVector, queryType?: string, ftsColumns?: string | string[]): VectorQuery | Query; |
"use strict"; | ||
// Copyright 2024 Lance Developers. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// SPDX-FileCopyrightText: Copyright The LanceDB Authors | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -95,5 +84,3 @@ exports.LocalTable = exports.Table = void 0; | ||
const schema = await this.schema(); | ||
const registry = (0, registry_1.getRegistry)(); | ||
const functions = await registry.parseFunctions(schema.metadata); | ||
const buffer = await (0, arrow_1.fromDataToBuffer)(data, functions.values().next().value, schema); | ||
const buffer = await (0, arrow_1.fromDataToBuffer)(data, undefined, schema); | ||
await this.inner.add(buffer, mode); | ||
@@ -158,2 +145,5 @@ } | ||
} | ||
async dropIndex(name) { | ||
await this.inner.dropIndex(name); | ||
} | ||
query() { | ||
@@ -250,3 +240,3 @@ return new query_1.Query(this.inner); | ||
on = Array.isArray(on) ? on : [on]; | ||
return new merge_1.MergeInsertBuilder(this.inner.mergeInsert(on)); | ||
return new merge_1.MergeInsertBuilder(this.inner.mergeInsert(on), this.schema()); | ||
} | ||
@@ -253,0 +243,0 @@ /** |
"use strict"; | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// SPDX-FileCopyrightText: Copyright The LanceDB Authors | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -3,0 +5,0 @@ exports.TTLCache = void 0; |
@@ -14,3 +14,3 @@ { | ||
"private": false, | ||
"version": "0.15.0", | ||
"version": "0.15.1-beta.2", | ||
"main": "dist/index.js", | ||
@@ -102,10 +102,10 @@ "exports": { | ||
"optionalDependencies": { | ||
"@lancedb/lancedb-darwin-x64": "0.15.0", | ||
"@lancedb/lancedb-darwin-arm64": "0.15.0", | ||
"@lancedb/lancedb-linux-x64-gnu": "0.15.0", | ||
"@lancedb/lancedb-linux-arm64-gnu": "0.15.0", | ||
"@lancedb/lancedb-linux-x64-musl": "0.15.0", | ||
"@lancedb/lancedb-linux-arm64-musl": "0.15.0", | ||
"@lancedb/lancedb-win32-x64-msvc": "0.15.0", | ||
"@lancedb/lancedb-win32-arm64-msvc": "0.15.0" | ||
"@lancedb/lancedb-darwin-x64": "0.15.1-beta.2", | ||
"@lancedb/lancedb-darwin-arm64": "0.15.1-beta.2", | ||
"@lancedb/lancedb-linux-x64-gnu": "0.15.1-beta.2", | ||
"@lancedb/lancedb-linux-arm64-gnu": "0.15.1-beta.2", | ||
"@lancedb/lancedb-linux-x64-musl": "0.15.1-beta.2", | ||
"@lancedb/lancedb-linux-arm64-musl": "0.15.1-beta.2", | ||
"@lancedb/lancedb-win32-x64-msvc": "0.15.1-beta.2", | ||
"@lancedb/lancedb-win32-arm64-msvc": "0.15.1-beta.2" | ||
}, | ||
@@ -112,0 +112,0 @@ "peerDependencies": { |
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
39
249662
1
80
5936