@lancedb/lancedb 0.13.1-beta.0 → 0.14.0-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/DEVELOPMENT.md +42 -0
- package/package.json +12 -9
- package/dist/arrow.d.ts +0 -248
- package/dist/arrow.js +0 -743
- package/dist/connection.d.ts +0 -188
- package/dist/connection.js +0 -149
- package/dist/embedding/embedding_function.d.ts +0 -90
- package/dist/embedding/embedding_function.js +0 -133
- package/dist/embedding/index.d.ts +0 -27
- package/dist/embedding/index.js +0 -112
- package/dist/embedding/openai.d.ts +0 -18
- package/dist/embedding/openai.js +0 -105
- package/dist/embedding/registry.d.ts +0 -55
- package/dist/embedding/registry.js +0 -151
- package/dist/embedding/transformers.d.ts +0 -37
- package/dist/embedding/transformers.js +0 -148
- package/dist/index.d.ts +0 -54
- package/dist/index.js +0 -55
- package/dist/indices.d.ts +0 -429
- package/dist/indices.js +0 -131
- package/dist/merge.d.ts +0 -54
- package/dist/merge.js +0 -64
- package/dist/native.d.ts +0 -328
- package/dist/native.js +0 -330
- package/dist/query.d.ts +0 -324
- package/dist/query.js +0 -544
- package/dist/sanitize.d.ts +0 -31
- package/dist/sanitize.js +0 -437
- package/dist/table.d.ts +0 -425
- package/dist/table.js +0 -276
- package/dist/util.d.ts +0 -13
- package/dist/util.js +0 -65
package/dist/util.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export type IntoSql = string | number | boolean | null | Date | ArrayBufferLike | Buffer | IntoSql[];
|
|
2
|
-
export declare function toSQL(value: IntoSql): string;
|
|
3
|
-
export declare class TTLCache {
|
|
4
|
-
private readonly ttl;
|
|
5
|
-
private readonly cache;
|
|
6
|
-
/**
|
|
7
|
-
* @param ttl Time to live in milliseconds
|
|
8
|
-
*/
|
|
9
|
-
constructor(ttl: number);
|
|
10
|
-
get(key: string): any | undefined;
|
|
11
|
-
set(key: string, value: any): void;
|
|
12
|
-
delete(key: string): void;
|
|
13
|
-
}
|
package/dist/util.js
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TTLCache = void 0;
|
|
4
|
-
exports.toSQL = toSQL;
|
|
5
|
-
function toSQL(value) {
|
|
6
|
-
if (typeof value === "string") {
|
|
7
|
-
return `'${value.replace(/'/g, "''")}'`;
|
|
8
|
-
}
|
|
9
|
-
else if (typeof value === "number") {
|
|
10
|
-
return value.toString();
|
|
11
|
-
}
|
|
12
|
-
else if (typeof value === "boolean") {
|
|
13
|
-
return value ? "TRUE" : "FALSE";
|
|
14
|
-
}
|
|
15
|
-
else if (value === null) {
|
|
16
|
-
return "NULL";
|
|
17
|
-
}
|
|
18
|
-
else if (value instanceof Date) {
|
|
19
|
-
return `'${value.toISOString()}'`;
|
|
20
|
-
}
|
|
21
|
-
else if (Array.isArray(value)) {
|
|
22
|
-
return `[${value.map(toSQL).join(", ")}]`;
|
|
23
|
-
}
|
|
24
|
-
else if (Buffer.isBuffer(value)) {
|
|
25
|
-
return `X'${value.toString("hex")}'`;
|
|
26
|
-
}
|
|
27
|
-
else if (value instanceof ArrayBuffer) {
|
|
28
|
-
return `X'${Buffer.from(value).toString("hex")}'`;
|
|
29
|
-
}
|
|
30
|
-
else {
|
|
31
|
-
throw new Error(`Unsupported value type: ${typeof value} value: (${value})`);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
class TTLCache {
|
|
35
|
-
ttl;
|
|
36
|
-
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
|
37
|
-
cache;
|
|
38
|
-
/**
|
|
39
|
-
* @param ttl Time to live in milliseconds
|
|
40
|
-
*/
|
|
41
|
-
constructor(ttl) {
|
|
42
|
-
this.ttl = ttl;
|
|
43
|
-
this.cache = new Map();
|
|
44
|
-
}
|
|
45
|
-
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
|
46
|
-
get(key) {
|
|
47
|
-
const entry = this.cache.get(key);
|
|
48
|
-
if (entry === undefined) {
|
|
49
|
-
return undefined;
|
|
50
|
-
}
|
|
51
|
-
if (entry.expires < Date.now()) {
|
|
52
|
-
this.cache.delete(key);
|
|
53
|
-
return undefined;
|
|
54
|
-
}
|
|
55
|
-
return entry.value;
|
|
56
|
-
}
|
|
57
|
-
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
|
58
|
-
set(key, value) {
|
|
59
|
-
this.cache.set(key, { value, expires: Date.now() + this.ttl });
|
|
60
|
-
}
|
|
61
|
-
delete(key) {
|
|
62
|
-
this.cache.delete(key);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
exports.TTLCache = TTLCache;
|