@workglow/storage 0.2.5 → 0.2.7

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.
Files changed (42) hide show
  1. package/dist/browser.js +89 -95
  2. package/dist/browser.js.map +14 -14
  3. package/dist/bun.js +127 -122
  4. package/dist/bun.js.map +20 -20
  5. package/dist/kv/KvViaTabularStorage.d.ts +3 -8
  6. package/dist/kv/KvViaTabularStorage.d.ts.map +1 -1
  7. package/dist/node.js +127 -122
  8. package/dist/node.js.map +20 -20
  9. package/dist/queue/PostgresQueueStorage.d.ts.map +1 -1
  10. package/dist/tabular/BaseSqlTabularStorage.d.ts +6 -1
  11. package/dist/tabular/BaseSqlTabularStorage.d.ts.map +1 -1
  12. package/dist/tabular/BaseTabularStorage.d.ts +1 -1
  13. package/dist/tabular/BaseTabularStorage.d.ts.map +1 -1
  14. package/dist/tabular/CachedTabularStorage.d.ts +1 -1
  15. package/dist/tabular/CachedTabularStorage.d.ts.map +1 -1
  16. package/dist/tabular/FsFolderTabularStorage.d.ts +1 -1
  17. package/dist/tabular/FsFolderTabularStorage.d.ts.map +1 -1
  18. package/dist/tabular/HuggingFaceTabularStorage.d.ts.map +1 -1
  19. package/dist/tabular/InMemoryTabularStorage.d.ts +1 -1
  20. package/dist/tabular/InMemoryTabularStorage.d.ts.map +1 -1
  21. package/dist/tabular/IndexedDbTabularStorage.d.ts +1 -1
  22. package/dist/tabular/IndexedDbTabularStorage.d.ts.map +1 -1
  23. package/dist/tabular/PostgresTabularStorage.d.ts +2 -2
  24. package/dist/tabular/PostgresTabularStorage.d.ts.map +1 -1
  25. package/dist/tabular/SharedInMemoryTabularStorage.d.ts +1 -1
  26. package/dist/tabular/SharedInMemoryTabularStorage.d.ts.map +1 -1
  27. package/dist/tabular/SqliteTabularStorage.d.ts +1 -1
  28. package/dist/tabular/SqliteTabularStorage.d.ts.map +1 -1
  29. package/dist/tabular/SupabaseTabularStorage.d.ts +1 -1
  30. package/dist/tabular/SupabaseTabularStorage.d.ts.map +1 -1
  31. package/dist/util/IndexedDbTable.d.ts.map +1 -1
  32. package/dist/vector/InMemoryVectorStorage.d.ts +8 -6
  33. package/dist/vector/InMemoryVectorStorage.d.ts.map +1 -1
  34. package/dist/vector/IndexedDbVectorStorage.d.ts +7 -9
  35. package/dist/vector/IndexedDbVectorStorage.d.ts.map +1 -1
  36. package/dist/vector/PostgresVectorStorage.d.ts +5 -5
  37. package/dist/vector/PostgresVectorStorage.d.ts.map +1 -1
  38. package/dist/vector/SqliteAiVectorStorage.d.ts +6 -6
  39. package/dist/vector/SqliteAiVectorStorage.d.ts.map +1 -1
  40. package/dist/vector/SqliteVectorStorage.d.ts +11 -7
  41. package/dist/vector/SqliteVectorStorage.d.ts.map +1 -1
  42. package/package.json +5 -5
@@ -4,31 +4,35 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
  import { Sqlite } from "@workglow/storage/sqlite";
7
- import type { DataPortSchemaObject, FromSchema, TypedArray, TypedArraySchemaOptions } from "@workglow/util/schema";
7
+ import type { DataPortSchemaObject, FromSchema, TypedArray, TypedArrayConstructor, TypedArraySchemaOptions } from "@workglow/util/schema";
8
8
  import { SqliteTabularStorage } from "../tabular/SqliteTabularStorage";
9
9
  import type { HybridSearchOptions, IVectorStorage, VectorSearchOptions } from "./IVectorStorage";
10
10
  /**
11
11
  * SQLite vector repository implementation using tabular storage underneath.
12
12
  * Stores vectors as JSON-encoded arrays with metadata.
13
13
  *
14
- * @template Vector - The vector type for the vector
15
- * @template Metadata - The metadata type for the vector
16
14
  * @template Schema - The schema for the vector
17
15
  * @template PrimaryKeyNames - The primary key names for the vector
16
+ * @template VectorCtor - Constructor for stored vectors (default {@link typeof Float32Array})
17
+ * @template Metadata - The metadata type for the vector
18
+ * @template Entity - The entity type for the vector
18
19
  */
19
- export declare class SqliteVectorStorage<Schema extends DataPortSchemaObject, PrimaryKeyNames extends ReadonlyArray<keyof Schema["properties"]>, Vector extends TypedArray = Float32Array, Metadata extends Record<string, unknown> | undefined = Record<string, unknown>, Entity = FromSchema<Schema, TypedArraySchemaOptions>> extends SqliteTabularStorage<Schema, PrimaryKeyNames, Entity> implements IVectorStorage<Metadata, Schema, Entity, PrimaryKeyNames> {
20
+ export declare class SqliteVectorStorage<Schema extends DataPortSchemaObject, PrimaryKeyNames extends ReadonlyArray<keyof Schema["properties"]>, Metadata extends Record<string, unknown> | undefined = Record<string, unknown>, Entity = FromSchema<Schema, TypedArraySchemaOptions>> extends SqliteTabularStorage<Schema, PrimaryKeyNames, Entity> implements IVectorStorage<Metadata, Schema, Entity, PrimaryKeyNames> {
20
21
  private vectorDimensions;
21
- private VectorType;
22
+ private readonly vectorCtor;
22
23
  private vectorPropertyName;
23
24
  private metadataPropertyName;
24
25
  /**
25
26
  * Creates a new SQLite vector repository
26
27
  * @param dbOrPath - Either a Database instance or a path to the SQLite database file
27
28
  * @param table - The name of the table to use for storage (defaults to 'vectors')
29
+ * @param schema - The schema for the entity
30
+ * @param primaryKeyNames - Array of property names forming the primary key
31
+ * @param indexes - Array of columns to index
28
32
  * @param dimensions - The number of dimensions of the vector
29
- * @param VectorType - The type of vector to use (defaults to Float32Array)
33
+ * @param vectorCtor - TypedArray constructor used when deserializing JSON vectors (e.g. {@link Float32Array})
30
34
  */
31
- constructor(dbOrPath: string | Sqlite.Database, table: string | undefined, schema: Schema, primaryKeyNames: PrimaryKeyNames, indexes: readonly (keyof Entity | readonly (keyof Entity)[])[] | undefined, dimensions: number, VectorType?: new (array: number[]) => TypedArray);
35
+ constructor(dbOrPath: string | Sqlite.Database, table: string | undefined, schema: Schema, primaryKeyNames: PrimaryKeyNames, indexes: readonly (keyof NoInfer<Entity> | readonly (keyof NoInfer<Entity>)[])[] | undefined, dimensions: number, vectorCtor?: TypedArrayConstructor);
32
36
  getVectorDimensions(): number;
33
37
  /**
34
38
  * Deserialize vector from JSON string
@@ -1 +1 @@
1
- {"version":3,"file":"SqliteVectorStorage.d.ts","sourceRoot":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jC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAwB;IACnD,OAAO,CAAC,kBAAkB,CAAe;IACzC,OAAO,CAAC,oBAAoB,CAA2B;IAEvD;;;;;;;;;OASG;IACH,YACE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC,QAAQ,EAClC,KAAK,EAAE,MAAM,YAAY,EACzB,MAAM,EAAE,MAAM,EACd,eAAe,EAAE,eAAe,EAChC,OAAO,EAAE,SAAS,CAAC,MAAM,OAAO,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,YAAK,EACrF,UAAU,EAAE,MAAM,EAClB,UAAU,GAAE,qBAAoC,EAcjD;IAED,mBAAmB,IAAI,MAAM,CAE5B;IAED;;;OAGG;IACH,OAAO,CAAC,iBAAiB;IAMnB,gBAAgB,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,GAAE,mBAAmB,CAAC,QAAQ,CAAM;eAE5C,MAAM;UAoC9C;IAEK,YAAY,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,mBAAmB,CAAC,QAAQ,CAAC;eAtCnC,MAAM;UAqG9C;CACF"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@workglow/storage",
3
3
  "type": "module",
4
- "version": "0.2.5",
4
+ "version": "0.2.7",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/workglow-dev/workglow.git",
@@ -40,8 +40,8 @@
40
40
  "@sqlite.org/sqlite-wasm": "^3.51.2-build8",
41
41
  "@supabase/supabase-js": "^2.103.0",
42
42
  "@sqliteai/sqlite-vector": "^0.9.90",
43
- "@workglow/util": "0.2.5",
44
- "better-sqlite3": "^12.8.0",
43
+ "@workglow/util": "0.2.7",
44
+ "better-sqlite3": "^12.9.0",
45
45
  "pg": "^8.20.0"
46
46
  },
47
47
  "peerDependenciesMeta": {
@@ -73,8 +73,8 @@
73
73
  "@supabase/supabase-js": "^2.103.0",
74
74
  "@types/better-sqlite3": "^7.6.13",
75
75
  "@types/pg": "^8.18.0",
76
- "@workglow/util": "0.2.5",
77
- "better-sqlite3": "^12.8.0",
76
+ "@workglow/util": "0.2.7",
77
+ "better-sqlite3": "^12.9.0",
78
78
  "fake-indexeddb": "^6.2.4",
79
79
  "pg": "^8.20.0"
80
80
  },