@lancedb/lancedb 0.15.0 → 0.15.1-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/arrow.js +11 -15
- package/dist/connection.js +2 -13
- package/dist/embedding/embedding_function.js +2 -13
- package/dist/embedding/index.js +2 -13
- package/dist/embedding/openai.js +2 -13
- package/dist/embedding/registry.js +2 -13
- package/dist/embedding/transformers.js +2 -13
- package/dist/index.js +2 -13
- package/dist/indices.js +2 -13
- package/dist/merge.d.ts +2 -2
- package/dist/merge.js +17 -5
- package/dist/native.d.ts +1 -0
- package/dist/query.js +2 -13
- package/dist/sanitize.js +2 -13
- package/dist/table.d.ts +14 -0
- package/dist/table.js +7 -17
- package/dist/util.js +2 -0
- package/license_header.txt +2 -0
- package/package.json +9 -9
package/dist/arrow.js
CHANGED
|
@@ -1,17 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
// you may not use this file except in compliance with the License.
|
|
6
|
-
// You may obtain a copy of the License at
|
|
7
|
-
//
|
|
8
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
//
|
|
10
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
// See the License for the specific language governing permissions and
|
|
14
|
-
// limitations under the License.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright The LanceDB Authors
|
|
15
4
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
16
5
|
if (k2 === undefined) k2 = k;
|
|
17
6
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -499,6 +488,12 @@ async function applyEmbeddings(table, embeddings, schema) {
|
|
|
499
488
|
else if (embeddings == null || embeddings === undefined) {
|
|
500
489
|
return table;
|
|
501
490
|
}
|
|
491
|
+
let schemaMetadata = schema?.metadata || new Map();
|
|
492
|
+
if (!(embeddings == null || embeddings === undefined)) {
|
|
493
|
+
const registry = (0, registry_1.getRegistry)();
|
|
494
|
+
const embeddingMetadata = registry.getTableMetadata([embeddings]);
|
|
495
|
+
schemaMetadata = new Map([...schemaMetadata, ...embeddingMetadata]);
|
|
496
|
+
}
|
|
502
497
|
// Convert from ArrowTable to Record<String, Vector>
|
|
503
498
|
const colEntries = [...Array(table.numCols).keys()].map((_, idx) => {
|
|
504
499
|
const name = table.schema.fields[idx].name;
|
|
@@ -553,13 +548,14 @@ async function applyEmbeddings(table, embeddings, schema) {
|
|
|
553
548
|
const destType = newVectorType(vectors[0].length, innerDestType);
|
|
554
549
|
newColumns[destColumn] = makeVector(vectors, destType);
|
|
555
550
|
}
|
|
556
|
-
|
|
551
|
+
let newTable = new apache_arrow_1.Table(newColumns);
|
|
557
552
|
if (schema != null) {
|
|
558
553
|
if (schema.fields.find((f) => f.name === destColumn) === undefined) {
|
|
559
554
|
throw new Error(`When using embedding functions and specifying a schema the schema should include the embedding column but the column ${destColumn} was missing`);
|
|
560
555
|
}
|
|
561
|
-
|
|
556
|
+
newTable = alignTable(newTable, schema);
|
|
562
557
|
}
|
|
558
|
+
newTable = new apache_arrow_1.Table(new apache_arrow_1.Schema(newTable.schema.fields, schemaMetadata), newTable.batches);
|
|
563
559
|
return newTable;
|
|
564
560
|
}
|
|
565
561
|
/**
|
package/dist/connection.js
CHANGED
|
@@ -1,17 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
// you may not use this file except in compliance with the License.
|
|
6
|
-
// You may obtain a copy of the License at
|
|
7
|
-
//
|
|
8
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
//
|
|
10
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
// See the License for the specific language governing permissions and
|
|
14
|
-
// limitations under the License.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright The LanceDB Authors
|
|
15
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
5
|
exports.LocalConnection = exports.Connection = void 0;
|
|
17
6
|
exports.cleanseStorageOptions = cleanseStorageOptions;
|
|
@@ -1,17 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
// you may not use this file except in compliance with the License.
|
|
6
|
-
// You may obtain a copy of the License at
|
|
7
|
-
//
|
|
8
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
//
|
|
10
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
// See the License for the specific language governing permissions and
|
|
14
|
-
// limitations under the License.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright The LanceDB Authors
|
|
15
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
5
|
exports.TextEmbeddingFunction = exports.EmbeddingFunction = void 0;
|
|
17
6
|
require("reflect-metadata");
|
package/dist/embedding/index.js
CHANGED
|
@@ -1,17 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
// you may not use this file except in compliance with the License.
|
|
6
|
-
// You may obtain a copy of the License at
|
|
7
|
-
//
|
|
8
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
//
|
|
10
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
// See the License for the specific language governing permissions and
|
|
14
|
-
// limitations under the License.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright The LanceDB Authors
|
|
15
4
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
16
5
|
if (k2 === undefined) k2 = k;
|
|
17
6
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
package/dist/embedding/openai.js
CHANGED
|
@@ -1,17 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
// you may not use this file except in compliance with the License.
|
|
6
|
-
// You may obtain a copy of the License at
|
|
7
|
-
//
|
|
8
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
//
|
|
10
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
// See the License for the specific language governing permissions and
|
|
14
|
-
// limitations under the License.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright The LanceDB Authors
|
|
15
4
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
16
5
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
17
6
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -1,17 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
// you may not use this file except in compliance with the License.
|
|
6
|
-
// You may obtain a copy of the License at
|
|
7
|
-
//
|
|
8
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
//
|
|
10
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
// See the License for the specific language governing permissions and
|
|
14
|
-
// limitations under the License.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright The LanceDB Authors
|
|
15
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
5
|
exports.EmbeddingFunctionRegistry = void 0;
|
|
17
6
|
exports.register = register;
|
|
@@ -1,17 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
// you may not use this file except in compliance with the License.
|
|
6
|
-
// You may obtain a copy of the License at
|
|
7
|
-
//
|
|
8
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
//
|
|
10
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
// See the License for the specific language governing permissions and
|
|
14
|
-
// limitations under the License.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright The LanceDB Authors
|
|
15
4
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
16
5
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
17
6
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
package/dist/index.js
CHANGED
|
@@ -1,17 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
// you may not use this file except in compliance with the License.
|
|
6
|
-
// You may obtain a copy of the License at
|
|
7
|
-
//
|
|
8
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
//
|
|
10
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
// See the License for the specific language governing permissions and
|
|
14
|
-
// limitations under the License.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright The LanceDB Authors
|
|
15
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
5
|
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;
|
|
17
6
|
exports.connect = connect;
|
package/dist/indices.js
CHANGED
|
@@ -1,17 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
// you may not use this file except in compliance with the License.
|
|
6
|
-
// You may obtain a copy of the License at
|
|
7
|
-
//
|
|
8
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
//
|
|
10
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
// See the License for the specific language governing permissions and
|
|
14
|
-
// limitations under the License.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright The LanceDB Authors
|
|
15
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
5
|
exports.Index = void 0;
|
|
17
6
|
const native_1 = require("./native");
|
package/dist/merge.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Data } from "./arrow";
|
|
1
|
+
import { Data, Schema } from "./arrow";
|
|
2
2
|
import { NativeMergeInsertBuilder } from "./native";
|
|
3
3
|
/** A builder used to create and run a merge insert operation */
|
|
4
4
|
export declare class MergeInsertBuilder {
|
|
5
5
|
#private;
|
|
6
6
|
/** Construct a MergeInsertBuilder. __Internal use only.__ */
|
|
7
|
-
constructor(native: NativeMergeInsertBuilder);
|
|
7
|
+
constructor(native: NativeMergeInsertBuilder, schema: Schema | Promise<Schema>);
|
|
8
8
|
/**
|
|
9
9
|
* Rows that exist in both the source table (new data) and
|
|
10
10
|
* the target table (old data) will be updated, replacing
|
package/dist/merge.js
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MergeInsertBuilder = void 0;
|
|
4
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
// SPDX-FileCopyrightText: Copyright The LanceDB Authors
|
|
4
6
|
const arrow_1 = require("./arrow");
|
|
5
7
|
/** A builder used to create and run a merge insert operation */
|
|
6
8
|
class MergeInsertBuilder {
|
|
7
9
|
#native;
|
|
10
|
+
#schema;
|
|
8
11
|
/** Construct a MergeInsertBuilder. __Internal use only.__ */
|
|
9
|
-
constructor(native) {
|
|
12
|
+
constructor(native, schema) {
|
|
10
13
|
this.#native = native;
|
|
14
|
+
this.#schema = schema;
|
|
11
15
|
}
|
|
12
16
|
/**
|
|
13
17
|
* Rows that exist in both the source table (new data) and
|
|
@@ -32,14 +36,14 @@ class MergeInsertBuilder {
|
|
|
32
36
|
* For example, "target.last_update < source.last_update"
|
|
33
37
|
*/
|
|
34
38
|
whenMatchedUpdateAll(options) {
|
|
35
|
-
return new MergeInsertBuilder(this.#native.whenMatchedUpdateAll(options?.where));
|
|
39
|
+
return new MergeInsertBuilder(this.#native.whenMatchedUpdateAll(options?.where), this.#schema);
|
|
36
40
|
}
|
|
37
41
|
/**
|
|
38
42
|
* Rows that exist only in the source table (new data) should
|
|
39
43
|
* be inserted into the target table.
|
|
40
44
|
*/
|
|
41
45
|
whenNotMatchedInsertAll() {
|
|
42
|
-
return new MergeInsertBuilder(this.#native.whenNotMatchedInsertAll());
|
|
46
|
+
return new MergeInsertBuilder(this.#native.whenNotMatchedInsertAll(), this.#schema);
|
|
43
47
|
}
|
|
44
48
|
/**
|
|
45
49
|
* Rows that exist only in the target table (old data) will be
|
|
@@ -49,7 +53,7 @@ class MergeInsertBuilder {
|
|
|
49
53
|
* @param options.where - An optional condition to limit what data is deleted
|
|
50
54
|
*/
|
|
51
55
|
whenNotMatchedBySourceDelete(options) {
|
|
52
|
-
return new MergeInsertBuilder(this.#native.whenNotMatchedBySourceDelete(options?.where));
|
|
56
|
+
return new MergeInsertBuilder(this.#native.whenNotMatchedBySourceDelete(options?.where), this.#schema);
|
|
53
57
|
}
|
|
54
58
|
/**
|
|
55
59
|
* Executes the merge insert operation
|
|
@@ -57,7 +61,15 @@ class MergeInsertBuilder {
|
|
|
57
61
|
* Nothing is returned but the `Table` is updated
|
|
58
62
|
*/
|
|
59
63
|
async execute(data) {
|
|
60
|
-
|
|
64
|
+
let schema;
|
|
65
|
+
if (this.#schema instanceof Promise) {
|
|
66
|
+
schema = await this.#schema;
|
|
67
|
+
this.#schema = schema; // In case of future calls
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
schema = this.#schema;
|
|
71
|
+
}
|
|
72
|
+
const buffer = await (0, arrow_1.fromDataToBuffer)(data, undefined, schema);
|
|
61
73
|
await this.#native.execute(buffer);
|
|
62
74
|
}
|
|
63
75
|
}
|
package/dist/native.d.ts
CHANGED
|
@@ -345,6 +345,7 @@ export class Table {
|
|
|
345
345
|
countRows(filter?: string | undefined | null): Promise<number>
|
|
346
346
|
delete(predicate: string): Promise<void>
|
|
347
347
|
createIndex(index: Index | undefined | null, column: string, replace?: boolean | undefined | null): Promise<void>
|
|
348
|
+
dropIndex(indexName: string): Promise<void>
|
|
348
349
|
update(onlyIf: string | undefined | null, columns: Array<[string, string]>): Promise<bigint>
|
|
349
350
|
query(): Query
|
|
350
351
|
vectorSearch(vector: Float32Array): VectorQuery
|
package/dist/query.js
CHANGED
|
@@ -1,17 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
// you may not use this file except in compliance with the License.
|
|
6
|
-
// You may obtain a copy of the License at
|
|
7
|
-
//
|
|
8
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
//
|
|
10
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
// See the License for the specific language governing permissions and
|
|
14
|
-
// limitations under the License.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright The LanceDB Authors
|
|
15
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
5
|
exports.Query = exports.VectorQuery = exports.QueryBase = exports.RecordBatchIterator = void 0;
|
|
17
6
|
const arrow_1 = require("./arrow");
|
package/dist/sanitize.js
CHANGED
|
@@ -1,17 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
// you may not use this file except in compliance with the License.
|
|
6
|
-
// You may obtain a copy of the License at
|
|
7
|
-
//
|
|
8
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
//
|
|
10
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
// See the License for the specific language governing permissions and
|
|
14
|
-
// limitations under the License.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright The LanceDB Authors
|
|
15
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
5
|
exports.sanitizeMetadata = sanitizeMetadata;
|
|
17
6
|
exports.sanitizeInt = sanitizeInt;
|
package/dist/table.d.ts
CHANGED
|
@@ -170,6 +170,17 @@ export declare abstract class Table {
|
|
|
170
170
|
* await table.createIndex("my_float_col");
|
|
171
171
|
*/
|
|
172
172
|
abstract createIndex(column: string, options?: Partial<IndexOptions>): Promise<void>;
|
|
173
|
+
/**
|
|
174
|
+
* Drop an index from the table.
|
|
175
|
+
*
|
|
176
|
+
* @param name The name of the index.
|
|
177
|
+
*
|
|
178
|
+
* @note This does not delete the index from disk, it just removes it from the table.
|
|
179
|
+
* To delete the index, run {@link Table#optimize} after dropping the index.
|
|
180
|
+
*
|
|
181
|
+
* Use {@link Table.listIndices} to find the names of the indices.
|
|
182
|
+
*/
|
|
183
|
+
abstract dropIndex(name: string): Promise<void>;
|
|
173
184
|
/**
|
|
174
185
|
* Create a {@link Query} Builder.
|
|
175
186
|
*
|
|
@@ -359,6 +370,8 @@ export declare abstract class Table {
|
|
|
359
370
|
*
|
|
360
371
|
* @param {string} name The name of the index.
|
|
361
372
|
* @returns {IndexStatistics | undefined} The stats of the index. If the index does not exist, it will return undefined
|
|
373
|
+
*
|
|
374
|
+
* Use {@link Table.listIndices} to find the names of the indices.
|
|
362
375
|
*/
|
|
363
376
|
abstract indexStats(name: string): Promise<IndexStatistics | undefined>;
|
|
364
377
|
static parseTableData(data: Record<string, unknown>[] | TableLike, options?: Partial<CreateTableOptions>, streaming?: boolean): Promise<{
|
|
@@ -385,6 +398,7 @@ export declare class LocalTable extends Table {
|
|
|
385
398
|
countRows(filter?: string): Promise<number>;
|
|
386
399
|
delete(predicate: string): Promise<void>;
|
|
387
400
|
createIndex(column: string, options?: Partial<IndexOptions>): Promise<void>;
|
|
401
|
+
dropIndex(name: string): Promise<void>;
|
|
388
402
|
query(): Query;
|
|
389
403
|
search(query: string | IntoVector, queryType?: string, ftsColumns?: string | string[]): VectorQuery | Query;
|
|
390
404
|
vectorSearch(vector: IntoVector): VectorQuery;
|
package/dist/table.js
CHANGED
|
@@ -1,17 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
// you may not use this file except in compliance with the License.
|
|
6
|
-
// You may obtain a copy of the License at
|
|
7
|
-
//
|
|
8
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
//
|
|
10
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
// See the License for the specific language governing permissions and
|
|
14
|
-
// limitations under the License.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright The LanceDB Authors
|
|
15
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
5
|
exports.LocalTable = exports.Table = void 0;
|
|
17
6
|
const arrow_1 = require("./arrow");
|
|
@@ -92,9 +81,7 @@ class LocalTable extends Table {
|
|
|
92
81
|
async add(data, options) {
|
|
93
82
|
const mode = options?.mode ?? "append";
|
|
94
83
|
const schema = await this.schema();
|
|
95
|
-
const
|
|
96
|
-
const functions = await registry.parseFunctions(schema.metadata);
|
|
97
|
-
const buffer = await (0, arrow_1.fromDataToBuffer)(data, functions.values().next().value, schema);
|
|
84
|
+
const buffer = await (0, arrow_1.fromDataToBuffer)(data, undefined, schema);
|
|
98
85
|
await this.inner.add(buffer, mode);
|
|
99
86
|
}
|
|
100
87
|
async update(optsOrUpdates, options) {
|
|
@@ -154,6 +141,9 @@ class LocalTable extends Table {
|
|
|
154
141
|
const nativeIndex = options?.config?.inner;
|
|
155
142
|
await this.inner.createIndex(nativeIndex, column, options?.replace);
|
|
156
143
|
}
|
|
144
|
+
async dropIndex(name) {
|
|
145
|
+
await this.inner.dropIndex(name);
|
|
146
|
+
}
|
|
157
147
|
query() {
|
|
158
148
|
return new query_1.Query(this.inner);
|
|
159
149
|
}
|
|
@@ -245,7 +235,7 @@ class LocalTable extends Table {
|
|
|
245
235
|
}
|
|
246
236
|
mergeInsert(on) {
|
|
247
237
|
on = Array.isArray(on) ? on : [on];
|
|
248
|
-
return new merge_1.MergeInsertBuilder(this.inner.mergeInsert(on));
|
|
238
|
+
return new merge_1.MergeInsertBuilder(this.inner.mergeInsert(on), this.schema());
|
|
249
239
|
}
|
|
250
240
|
/**
|
|
251
241
|
* Check if the table uses the new manifest path scheme.
|
package/dist/util.js
CHANGED
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"ann"
|
|
12
12
|
],
|
|
13
13
|
"private": false,
|
|
14
|
-
"version": "0.15.
|
|
14
|
+
"version": "0.15.1-beta.2",
|
|
15
15
|
"main": "dist/index.js",
|
|
16
16
|
"exports": {
|
|
17
17
|
".": "./dist/index.js",
|
|
@@ -98,14 +98,14 @@
|
|
|
98
98
|
"reflect-metadata": "^0.2.2"
|
|
99
99
|
},
|
|
100
100
|
"optionalDependencies": {
|
|
101
|
-
"@lancedb/lancedb-darwin-x64": "0.15.
|
|
102
|
-
"@lancedb/lancedb-darwin-arm64": "0.15.
|
|
103
|
-
"@lancedb/lancedb-linux-x64-gnu": "0.15.
|
|
104
|
-
"@lancedb/lancedb-linux-arm64-gnu": "0.15.
|
|
105
|
-
"@lancedb/lancedb-linux-x64-musl": "0.15.
|
|
106
|
-
"@lancedb/lancedb-linux-arm64-musl": "0.15.
|
|
107
|
-
"@lancedb/lancedb-win32-x64-msvc": "0.15.
|
|
108
|
-
"@lancedb/lancedb-win32-arm64-msvc": "0.15.
|
|
101
|
+
"@lancedb/lancedb-darwin-x64": "0.15.1-beta.2",
|
|
102
|
+
"@lancedb/lancedb-darwin-arm64": "0.15.1-beta.2",
|
|
103
|
+
"@lancedb/lancedb-linux-x64-gnu": "0.15.1-beta.2",
|
|
104
|
+
"@lancedb/lancedb-linux-arm64-gnu": "0.15.1-beta.2",
|
|
105
|
+
"@lancedb/lancedb-linux-x64-musl": "0.15.1-beta.2",
|
|
106
|
+
"@lancedb/lancedb-linux-arm64-musl": "0.15.1-beta.2",
|
|
107
|
+
"@lancedb/lancedb-win32-x64-msvc": "0.15.1-beta.2",
|
|
108
|
+
"@lancedb/lancedb-win32-arm64-msvc": "0.15.1-beta.2"
|
|
109
109
|
},
|
|
110
110
|
"peerDependencies": {
|
|
111
111
|
"apache-arrow": ">=15.0.0 <=18.1.0"
|