@workglow/storage 0.2.26 → 0.2.28

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 (94) hide show
  1. package/dist/browser.d.ts +0 -10
  2. package/dist/browser.d.ts.map +1 -1
  3. package/dist/browser.js +407 -4002
  4. package/dist/browser.js.map +8 -24
  5. package/dist/bun.js +496 -6711
  6. package/dist/bun.js.map +8 -34
  7. package/dist/common-server.d.ts +1 -21
  8. package/dist/common-server.d.ts.map +1 -1
  9. package/dist/common.d.ts +1 -6
  10. package/dist/common.d.ts.map +1 -1
  11. package/dist/node.js +496 -6712
  12. package/dist/node.js.map +8 -34
  13. package/dist/tabular/SharedInMemoryTabularStorage.d.ts +2 -1
  14. package/dist/tabular/SharedInMemoryTabularStorage.d.ts.map +1 -1
  15. package/package.json +5 -71
  16. package/dist/kv/IndexedDbKvStorage.d.ts +0 -27
  17. package/dist/kv/IndexedDbKvStorage.d.ts.map +0 -1
  18. package/dist/kv/PostgresKvStorage.d.ts +0 -28
  19. package/dist/kv/PostgresKvStorage.d.ts.map +0 -1
  20. package/dist/kv/SqliteKvStorage.d.ts +0 -28
  21. package/dist/kv/SqliteKvStorage.d.ts.map +0 -1
  22. package/dist/kv/SupabaseKvStorage.d.ts +0 -33
  23. package/dist/kv/SupabaseKvStorage.d.ts.map +0 -1
  24. package/dist/postgres/browser.d.ts +0 -32
  25. package/dist/postgres/browser.d.ts.map +0 -1
  26. package/dist/postgres/browser.js +0 -150
  27. package/dist/postgres/browser.js.map +0 -11
  28. package/dist/postgres/node-bun.d.ts +0 -26
  29. package/dist/postgres/node-bun.d.ts.map +0 -1
  30. package/dist/postgres/node-bun.js +0 -41
  31. package/dist/postgres/node-bun.js.map +0 -10
  32. package/dist/postgres/pglite-pool.d.ts +0 -21
  33. package/dist/postgres/pglite-pool.d.ts.map +0 -1
  34. package/dist/queue/IQueueStorage.d.ts +0 -206
  35. package/dist/queue/IQueueStorage.d.ts.map +0 -1
  36. package/dist/queue/InMemoryQueueStorage.d.ts +0 -148
  37. package/dist/queue/InMemoryQueueStorage.d.ts.map +0 -1
  38. package/dist/queue/IndexedDbQueueStorage.d.ts +0 -165
  39. package/dist/queue/IndexedDbQueueStorage.d.ts.map +0 -1
  40. package/dist/queue/PostgresQueueStorage.d.ts +0 -133
  41. package/dist/queue/PostgresQueueStorage.d.ts.map +0 -1
  42. package/dist/queue/SqliteQueueStorage.d.ts +0 -141
  43. package/dist/queue/SqliteQueueStorage.d.ts.map +0 -1
  44. package/dist/queue/SupabaseQueueStorage.d.ts +0 -194
  45. package/dist/queue/SupabaseQueueStorage.d.ts.map +0 -1
  46. package/dist/queue/TelemetryQueueStorage.d.ts +0 -32
  47. package/dist/queue/TelemetryQueueStorage.d.ts.map +0 -1
  48. package/dist/queue-limiter/IRateLimiterStorage.d.ts +0 -81
  49. package/dist/queue-limiter/IRateLimiterStorage.d.ts.map +0 -1
  50. package/dist/queue-limiter/InMemoryRateLimiterStorage.d.ts +0 -32
  51. package/dist/queue-limiter/InMemoryRateLimiterStorage.d.ts.map +0 -1
  52. package/dist/queue-limiter/IndexedDbRateLimiterStorage.d.ts +0 -52
  53. package/dist/queue-limiter/IndexedDbRateLimiterStorage.d.ts.map +0 -1
  54. package/dist/queue-limiter/PostgresRateLimiterStorage.d.ts +0 -54
  55. package/dist/queue-limiter/PostgresRateLimiterStorage.d.ts.map +0 -1
  56. package/dist/queue-limiter/SqliteRateLimiterStorage.d.ts +0 -53
  57. package/dist/queue-limiter/SqliteRateLimiterStorage.d.ts.map +0 -1
  58. package/dist/queue-limiter/SupabaseRateLimiterStorage.d.ts +0 -49
  59. package/dist/queue-limiter/SupabaseRateLimiterStorage.d.ts.map +0 -1
  60. package/dist/sqlite/browser.d.ts +0 -37
  61. package/dist/sqlite/browser.d.ts.map +0 -1
  62. package/dist/sqlite/browser.js +0 -125
  63. package/dist/sqlite/browser.js.map +0 -10
  64. package/dist/sqlite/bun.d.ts +0 -32
  65. package/dist/sqlite/bun.d.ts.map +0 -1
  66. package/dist/sqlite/bun.js +0 -84
  67. package/dist/sqlite/bun.js.map +0 -10
  68. package/dist/sqlite/canonical-api.d.ts +0 -34
  69. package/dist/sqlite/canonical-api.d.ts.map +0 -1
  70. package/dist/sqlite/node.d.ts +0 -34
  71. package/dist/sqlite/node.d.ts.map +0 -1
  72. package/dist/sqlite/node.js +0 -65
  73. package/dist/sqlite/node.js.map +0 -10
  74. package/dist/tabular/IndexedDbTabularStorage.d.ts +0 -199
  75. package/dist/tabular/IndexedDbTabularStorage.d.ts.map +0 -1
  76. package/dist/tabular/PostgresTabularStorage.d.ts +0 -196
  77. package/dist/tabular/PostgresTabularStorage.d.ts.map +0 -1
  78. package/dist/tabular/SqliteTabularStorage.d.ts +0 -167
  79. package/dist/tabular/SqliteTabularStorage.d.ts.map +0 -1
  80. package/dist/tabular/SupabaseTabularStorage.d.ts +0 -174
  81. package/dist/tabular/SupabaseTabularStorage.d.ts.map +0 -1
  82. package/dist/util/IndexedDbTable.d.ts +0 -40
  83. package/dist/util/IndexedDbTable.d.ts.map +0 -1
  84. package/dist/util/traced.d.ts +0 -10
  85. package/dist/util/traced.d.ts.map +0 -1
  86. package/dist/vector/IndexedDbVectorStorage.d.ts +0 -53
  87. package/dist/vector/IndexedDbVectorStorage.d.ts.map +0 -1
  88. package/dist/vector/PostgresVectorStorage.d.ts +0 -39
  89. package/dist/vector/PostgresVectorStorage.d.ts.map +0 -1
  90. package/dist/vector/SqliteAiVectorStorage.d.ts +0 -100
  91. package/dist/vector/SqliteAiVectorStorage.d.ts.map +0 -1
  92. package/dist/vector/SqliteVectorStorage.d.ts +0 -49
  93. package/dist/vector/SqliteVectorStorage.d.ts.map +0 -1
  94. package/src/queue/README.md +0 -41
@@ -1,199 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2025 Steven Roussey <sroussey@gmail.com>
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
- import { DataPortSchemaObject, FromSchema, TypedArraySchemaOptions } from "@workglow/util/schema";
7
- import { MigrationOptions } from "../util/IndexedDbTable";
8
- import { BaseTabularStorage, ClientProvidedKeysOption, KeyGenerationStrategy } from "./BaseTabularStorage";
9
- import { AnyTabularStorage, AutoGeneratedKeys, CoveringIndexQueryOptions, DeleteSearchCriteria, InsertEntity, QueryOptions, SearchCriteria, SimplifyPrimaryKey, TabularChangePayload, TabularSubscribeOptions } from "./ITabularStorage";
10
- export declare const IDB_TABULAR_REPOSITORY: import("@workglow/util").ServiceToken<AnyTabularStorage>;
11
- /**
12
- * A tabular repository implementation using IndexedDB for browser-based storage.
13
- *
14
- * @template Schema - The schema definition for the entity
15
- * @template PrimaryKeyNames - Array of property names that form the primary key
16
- */
17
- export declare class IndexedDbTabularStorage<Schema extends DataPortSchemaObject, PrimaryKeyNames extends ReadonlyArray<keyof Schema["properties"]>, Entity = FromSchema<Schema, TypedArraySchemaOptions>, PrimaryKey = SimplifyPrimaryKey<Entity, PrimaryKeyNames>, Value = Omit<Entity, PrimaryKeyNames[number] & keyof Entity>, InsertType extends InsertEntity<Entity, AutoGeneratedKeys<Schema>> = InsertEntity<Entity, AutoGeneratedKeys<Schema>>> extends BaseTabularStorage<Schema, PrimaryKeyNames, Entity, PrimaryKey, Value, InsertType> {
18
- table: string;
19
- /** Promise that resolves to the IndexedDB database instance */
20
- private db;
21
- /** Promise to track ongoing database setup to prevent concurrent setup calls */
22
- private setupPromise;
23
- /** Migration options for database schema changes */
24
- private migrationOptions;
25
- /** Shared hybrid subscription manager */
26
- private hybridManager;
27
- /** Hybrid subscription options */
28
- private readonly hybridOptions;
29
- /**
30
- * Indexes safe for cursor-based narrowing. An IDB index excludes records
31
- * whose keyPath has any undefined component, so iterating an index can miss
32
- * records when an indexed column is optional in the schema. Native
33
- * `count(range)` and cursor scans are only correct over indexes whose every
34
- * column is required. Computed lazily on first use.
35
- */
36
- private cursorSafeIndexes;
37
- /**
38
- * Creates a new IndexedDB-based tabular repository.
39
- * @param table - Name of the IndexedDB store to use.
40
- * @param schema - Schema defining the structure of the entity
41
- * @param primaryKeyNames - Array of property names that form the primary key
42
- * @param indexes - Array of columns or column arrays to make searchable. Each string or single column creates a single-column index,
43
- * while each array creates a compound index with columns in the specified order.
44
- * @param migrationOptions - Options for handling database schema migrations
45
- * @param clientProvidedKeys - How to handle client-provided values for auto-generated keys
46
- */
47
- constructor(table: string | undefined, schema: Schema, primaryKeyNames: PrimaryKeyNames, indexes?: readonly (keyof NoInfer<Entity> | readonly (keyof NoInfer<Entity>)[])[], migrationOptions?: MigrationOptions & {
48
- readonly useBroadcastChannel?: boolean;
49
- readonly backupPollingIntervalMs?: number;
50
- }, clientProvidedKeys?: ClientProvidedKeysOption);
51
- private getDb;
52
- /**
53
- * Sets up the IndexedDB database table with the required schema and indexes.
54
- * Must be called before using any other methods.
55
- */
56
- setupDatabase(): Promise<void>;
57
- private performSetup;
58
- /**
59
- * Generates a key value for UUID keys
60
- * Integer autoincrement keys are handled by IndexedDB's autoIncrement
61
- * @param columnName - Name of the column to generate a key for
62
- * @param strategy - The generation strategy to use
63
- * @returns The generated key value
64
- */
65
- protected generateKeyValue(columnName: string, strategy: KeyGenerationStrategy): string | number;
66
- /**
67
- * Stores a row in the repository.
68
- * @param record - The entity to store (may be missing auto-generated keys).
69
- * @returns The stored entity
70
- * @emits put - Emitted when the value is successfully stored
71
- */
72
- put(record: InsertType): Promise<Entity>;
73
- /**
74
- * Stores multiple rows in the repository in a bulk operation.
75
- * @param records - Array of entities to store (may be missing auto-generated keys).
76
- * @returns Array of stored entities
77
- * @emits put - Emitted for each record successfully stored
78
- */
79
- putBulk(records: InsertType[]): Promise<Entity[]>;
80
- protected getPrimaryKeyAsOrderedArray(key: PrimaryKey): (string | number | boolean | Uint8Array<ArrayBufferLike> | null)[];
81
- private getIndexedKey;
82
- /**
83
- * Retrieves a value from the repository by its key.
84
- * @param key - The key object.
85
- * @returns The value object or undefined if not found.
86
- * @emits get - Emitted when the value is successfully retrieved
87
- */
88
- get(key: PrimaryKey): Promise<Entity | undefined>;
89
- /**
90
- * Returns an array of all entries in the repository, with optional ordering, offset, and limit.
91
- * @param options - Optional ordering, limit, and offset options
92
- * @returns Array of all entries in the repository.
93
- */
94
- getAll(options?: QueryOptions<Entity>): Promise<Entity[] | undefined>;
95
- /**
96
- * Deletes a row from the repository.
97
- * @param key - The key object to delete.
98
- */
99
- delete(key: PrimaryKey): Promise<void>;
100
- /**
101
- * Deletes all records from the repository.
102
- * @emits clearall - Emitted when all values are deleted
103
- */
104
- deleteAll(): Promise<void>;
105
- /**
106
- * Returns the total number of rows in the repository.
107
- * @returns Count of stored items.
108
- */
109
- size(): Promise<number>;
110
- /**
111
- * Returns the subset of configured indexes safe to use for cursor-based
112
- * narrowing — those whose every column is required by the schema. IDB
113
- * excludes records with undefined keyPath components from indexes, so
114
- * iterating an index would silently miss records when any indexed column
115
- * is optional.
116
- */
117
- private getCursorSafeIndexes;
118
- /**
119
- * Picks the best index to narrow a criteria-based scan, preferring indexes
120
- * whose prefix covers every criteria column (so callers can use the native
121
- * `count()` API) and falling back to the longest equality-prefix match.
122
- *
123
- * Upper bound uses `[]` as a sentinel that compares greater than any
124
- * primitive value at the next index position (per IndexedDB key ordering:
125
- * array > binary > string > date > number). Assumes subsequent indexed
126
- * columns hold primitive values — array-valued columns would compare
127
- * greater than `[]` and slip outside the range.
128
- */
129
- private createIndexedRange;
130
- /**
131
- * Counts rows matching the specified search criteria.
132
- *
133
- * Uses the native `count()` API when an index prefix covers every criteria
134
- * column. Otherwise narrows via the longest matching index prefix and
135
- * filters the remaining columns during cursor iteration. Falls back to a
136
- * full store scan only when no index applies.
137
- */
138
- count(criteria?: SearchCriteria<Entity>): Promise<number>;
139
- /**
140
- * Fetches a page of records from the repository.
141
- * @param offset - Number of records to skip
142
- * @param limit - Maximum number of records to return
143
- * @returns Array of entities or undefined if no records found
144
- */
145
- getBulk(offset: number, limit: number): Promise<Entity[] | undefined>;
146
- /**
147
- * Checks if a record matches all criteria conditions.
148
- * @param record - The record to check
149
- * @param criteria - The search criteria
150
- * @returns true if all conditions match
151
- */
152
- private matchesCriteria;
153
- /**
154
- * Deletes all entries matching the specified search criteria.
155
- * Supports multiple columns with optional comparison operators.
156
- *
157
- * @param criteria - Object with column names as keys and values or SearchConditions
158
- */
159
- deleteSearch(criteria: DeleteSearchCriteria<Entity>): Promise<void>;
160
- private getEqualityCriterionValue;
161
- private compareByOrder;
162
- private createIndexedQuery;
163
- /**
164
- * Queries entries matching the specified search criteria with optional ordering, limit, and offset.
165
- *
166
- * @param criteria - Object with column names as keys and values or SearchConditions
167
- * @param options - Optional ordering, limit, and offset options
168
- * @returns Array of matching entities or undefined if no matches found
169
- */
170
- query(criteria: SearchCriteria<Entity>, options?: QueryOptions<Entity>): Promise<Entity[] | undefined>;
171
- /**
172
- * Strict, projected query served entirely by a covering compound index.
173
- * Uses `openKeyCursor` — never reads `cursor.value` — so only the index key
174
- * bytes are loaded into memory. Ideal for tables with large value blobs.
175
- *
176
- * Throws {@link CoveringIndexMissingError} when no registered index can serve
177
- * the request (i.e. the index does not cover all select + orderBy columns).
178
- */
179
- queryIndex<K extends keyof Entity & string>(criteria: SearchCriteria<Entity>, options: CoveringIndexQueryOptions<Entity, K>): Promise<Pick<Entity, K>[]>;
180
- /**
181
- * Gets or creates the shared hybrid subscription manager.
182
- * This ensures all subscriptions share a single manager.
183
- */
184
- private getHybridManager;
185
- /**
186
- * Subscribes to changes in the repository.
187
- * Uses polling since IndexedDB has no native cross-tab change notifications.
188
- *
189
- * @param callback - Function called when a change occurs
190
- * @param options - Optional subscription options including polling interval
191
- * @returns Unsubscribe function
192
- */
193
- subscribeToChanges(callback: (change: TabularChangePayload<Entity>) => void, options?: TabularSubscribeOptions): () => void;
194
- /**
195
- * Destroys this repository and frees up resources.
196
- */
197
- destroy(): void;
198
- }
199
- //# sourceMappingURL=IndexedDbTabularStorage.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IndexedDbTabularStorage.d.ts","sourceRoot":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AC,CAAC,EAAE,CAAC,CA+H5B;IAED;;;OAGG;IACH,OAAO,CAAC,gBAAgB;IA0CxB;;;;;;;OAOG;IACa,kBAAkB,CAChC,QAAQ,EAAE,CAAC,MAAM,EAAE,oBAAoB,CAAC,MAAM,CAAC,KAAK,IAAI,EACxD,OAAO,CAAC,EAAE,uBAAuB,GAChC,MAAM,IAAI,CAMZ;IAED;;OAEG;IACa,OAAO,IAAI,IAAI,CAM9B;CACF"}
@@ -1,196 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2025 Steven Roussey <sroussey@gmail.com>
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
- import type { Pool } from "@workglow/storage/postgres";
7
- import { DataPortSchemaObject, FromSchema, JsonSchema, TypedArraySchemaOptions } from "@workglow/util/schema";
8
- import { BaseSqlTabularStorage } from "./BaseSqlTabularStorage";
9
- import { ClientProvidedKeysOption } from "./BaseTabularStorage";
10
- import { AnyTabularStorage, AutoGeneratedKeys, CoveringIndexQueryOptions, DeleteSearchCriteria, InsertEntity, QueryOptions, SearchCriteria, SimplifyPrimaryKey, TabularChangePayload, TabularSubscribeOptions, ValueOptionType } from "./ITabularStorage";
11
- export declare const POSTGRES_TABULAR_REPOSITORY: import("@workglow/util").ServiceToken<AnyTabularStorage>;
12
- /**
13
- * A PostgreSQL-based tabular repository implementation that extends BaseSqlTabularStorage.
14
- * This class provides persistent storage for data in a PostgreSQL database,
15
- * making it suitable for multi-user scenarios.
16
- *
17
- * @template Schema - The schema definition for the entity
18
- * @template PrimaryKeyNames - Array of property names that form the primary key
19
- */
20
- export declare class PostgresTabularStorage<Schema extends DataPortSchemaObject, PrimaryKeyNames extends ReadonlyArray<keyof Schema["properties"]>, Entity = FromSchema<Schema, TypedArraySchemaOptions>, PrimaryKey = SimplifyPrimaryKey<Entity, PrimaryKeyNames>, Value = Omit<Entity, PrimaryKeyNames[number] & keyof Entity>, InsertType extends InsertEntity<Entity, AutoGeneratedKeys<Schema>> = InsertEntity<Entity, AutoGeneratedKeys<Schema>>> extends BaseSqlTabularStorage<Schema, PrimaryKeyNames, Entity, PrimaryKey, Value, InsertType> {
21
- protected db: Pool;
22
- /**
23
- * Creates a new PostgresTabularStorage instance.
24
- *
25
- * @param db - PostgreSQL db
26
- * @param table - Name of the table to store data (defaults to "tabular_store")
27
- * @param schema - Schema defining the structure of the entity
28
- * @param primaryKeyNames - Array of property names that form the primary key
29
- * @param indexes - Array of columns or column arrays to make searchable. Each string or single column creates a single-column index,
30
- * while each array creates a compound index with columns in the specified order.
31
- * @param clientProvidedKeys - How to handle client-provided values for auto-generated keys
32
- */
33
- constructor(db: Pool, table: string | undefined, schema: Schema, primaryKeyNames: PrimaryKeyNames, indexes?: readonly (keyof NoInfer<Entity> | readonly (keyof NoInfer<Entity>)[])[], clientProvidedKeys?: ClientProvidedKeysOption);
34
- /**
35
- * Initializes the database table with the required schema.
36
- * Creates the table if it doesn't exist with primary key and value columns.
37
- * Must be called before using any other methods.
38
- */
39
- setupDatabase(): Promise<void>;
40
- protected isVectorFormat(format?: string): boolean;
41
- protected getVectorDimensions(typeDef: JsonSchema): number | undefined;
42
- /**
43
- * Maps TypeScript/JavaScript types to corresponding PostgreSQL data types.
44
- * Uses additional schema information like minimum/maximum values, nullable status,
45
- * and string lengths to create more optimized column types.
46
- *
47
- * @param typeDef - The TypeScript/JavaScript type to map
48
- * @returns The corresponding PostgreSQL data type
49
- */
50
- protected mapTypeToSQL(typeDef: JsonSchema): string;
51
- /**
52
- * Generates the SQL column definitions for primary key fields with constraints
53
- * Handles auto-generated keys using SERIAL for integers and UUID DEFAULT for strings
54
- * @returns SQL string containing primary key column definitions
55
- */
56
- protected constructPrimaryKeyColumns($delimiter?: string): string;
57
- /**
58
- * Generates the SQL column definitions for value fields with constraints
59
- * @returns SQL string containing value column definitions
60
- */
61
- protected constructValueColumns($delimiter?: string): string;
62
- /**
63
- * Convert JavaScript values to PostgreSQL values, including TypedArray to vector string
64
- */
65
- protected jsToSqlValue(column: string, value: Entity[keyof Entity]): ValueOptionType;
66
- /**
67
- * Convert PostgreSQL values to JS values. Ensures numeric strings become numbers where schema says number.
68
- */
69
- protected sqlToJsValue(column: string, value: ValueOptionType): Entity[keyof Entity];
70
- /**
71
- * Determines if a field should be treated as unsigned based on schema properties
72
- * @param typeDef - The schema type definition
73
- * @returns true if the field should be treated as unsigned
74
- */
75
- protected shouldBeUnsigned(typeDef: JsonSchema): boolean;
76
- /**
77
- * Gets information about vector columns in the schema
78
- * @returns Array of objects with column name and dimension
79
- */
80
- protected getVectorColumns(): Array<{
81
- column: string;
82
- dimension: number;
83
- }>;
84
- /**
85
- * Creates vector-specific indexes (HNSW for pgvector)
86
- * Called after table creation if vector columns exist
87
- */
88
- protected createVectorIndexes(): Promise<void>;
89
- /**
90
- * Stores or updates a row in the database.
91
- * Uses UPSERT (INSERT ... ON CONFLICT DO UPDATE) for atomic operations.
92
- *
93
- * @param entity - The entity to store (may be missing auto-generated keys)
94
- * @returns The entity with any server-generated fields updated
95
- * @emits "put" event with the updated entity when successful
96
- */
97
- put(entity: InsertType): Promise<Entity>;
98
- /**
99
- * Stores multiple rows in the database in a bulk operation.
100
- * Uses individual put calls to ensure auto-generated keys are handled correctly.
101
- *
102
- * @param entities - Array of entities to store (may be missing auto-generated keys)
103
- * @returns Array of entities with any server-generated fields updated
104
- * @emits "put" event for each entity stored
105
- */
106
- putBulk(entities: InsertType[]): Promise<Entity[]>;
107
- /**
108
- * Retrieves a value from the database by its primary key.
109
- *
110
- * @param key - The primary key object to look up
111
- * @returns The stored value or undefined if not found
112
- * @emits "get" event with the key when successful
113
- */
114
- get(key: PrimaryKey): Promise<Entity | undefined>;
115
- /**
116
- * Deletes a row from the database.
117
- *
118
- * @param key - The primary key object to delete
119
- * @emits "delete" event with the key when successful
120
- */
121
- delete(value: PrimaryKey | Entity): Promise<void>;
122
- /**
123
- * Retrieves all entries from the database table, with optional ordering, offset, and limit.
124
- * @param options - Optional ordering, limit, and offset options
125
- * @returns Promise resolving to an array of entries or undefined if not found
126
- */
127
- getAll(options?: QueryOptions<Entity>): Promise<Entity[] | undefined>;
128
- /**
129
- * Deletes all rows from the database table.
130
- * @emits "clearall" event when successful
131
- */
132
- deleteAll(): Promise<void>;
133
- /**
134
- * Returns the total number of rows in the database.
135
- *
136
- * @returns Promise resolving to the count of stored items
137
- */
138
- size(): Promise<number>;
139
- /**
140
- * Counts rows matching the specified search criteria.
141
- */
142
- count(criteria?: SearchCriteria<Entity>): Promise<number>;
143
- /**
144
- * Fetches a page of records from the repository.
145
- * @param offset - Number of records to skip
146
- * @param limit - Maximum number of records to return
147
- * @returns Array of entities or undefined if no records found
148
- */
149
- getBulk(offset: number, limit: number): Promise<Entity[] | undefined>;
150
- /**
151
- * Builds WHERE clause conditions from delete search criteria.
152
- * @param criteria - The search criteria object
153
- * @returns Object with whereClause string and params array
154
- */
155
- protected buildDeleteSearchWhere(criteria: DeleteSearchCriteria<Entity>): {
156
- whereClause: string;
157
- params: ValueOptionType[];
158
- };
159
- /**
160
- * Deletes all entries matching the specified search criteria.
161
- * Supports multiple columns with optional comparison operators.
162
- *
163
- * @param criteria - Object with column names as keys and values or SearchConditions
164
- */
165
- deleteSearch(criteria: DeleteSearchCriteria<Entity>): Promise<void>;
166
- /**
167
- * Queries entries matching the specified search criteria with optional ordering, limit, and offset.
168
- *
169
- * @param criteria - Object with column names as keys and values or SearchConditions
170
- * @param options - Optional ordering, limit, and offset options
171
- * @returns Array of matching entities or undefined if no matches found
172
- */
173
- query(criteria: SearchCriteria<Entity>, options?: QueryOptions<Entity>): Promise<Entity[] | undefined>;
174
- /**
175
- * Queries entries matching the specified search criteria, returning only the selected columns.
176
- * Requires a covering index that satisfies the criteria, orderBy, and select columns.
177
- *
178
- * @param criteria - Object with column names as keys and values or SearchConditions
179
- * @param options - Required select columns plus optional orderBy, limit, and offset
180
- * @returns Array of partial entities containing only the selected columns
181
- * @throws {CoveringIndexMissingError} when no registered index covers the query
182
- */
183
- queryIndex<K extends keyof Entity & string>(criteria: SearchCriteria<Entity>, options: CoveringIndexQueryOptions<Entity, K>): Promise<Pick<Entity, K>[]>;
184
- /**
185
- * Subscribes to changes in the repository.
186
- * NOT IMPLEMENTED for PostgreSQL storage.
187
- *
188
- * @throws Error always - subscribeToChanges is not supported for PostgreSQL storage
189
- */
190
- subscribeToChanges(callback: (change: TabularChangePayload<Entity>) => void, options?: TabularSubscribeOptions): () => void;
191
- /**
192
- * Destroys the repository and frees up resources.
193
- */
194
- destroy(): void;
195
- }
196
- //# sourceMappingURL=PostgresTabularStorage.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PostgresTabularStorage.d.ts","sourceRoot":"","sources":["../../src/tabular/PostgresTabularStorage.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAGvD,OAAO,EACL,oBAAoB,EACpB,UAAU,EACV,UAAU,EACV,uBAAuB,EACxB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,yBAAyB,EACzB,oBAAoB,EACpB,YAAY,EAEZ,YAAY,EACZ,cAAc,EAEd,kBAAkB,EAClB,oBAAoB,EACpB,uBAAuB,EACvB,eAAe,EAChB,MAAM,mBAAmB,CAAC;AAG3B,eAAO,MAAM,2BAA2B,0DAEvC,CAAC;AAEF;;;;;;;GAOG;AACH,qBAAa,sBAAsB,CACjC,MAAM,SAAS,oBAAoB,EACnC,eAAe,SAAS,aAAa,CAAC,MAAM,MAAM,CAAC,YAAY,CAAC,CAAC,EAEjE,MAAM,GAAG,UAAU,CAAC,MAAM,EAAE,uBAAuB,CAAC,EACpD,UAAU,GAAG,kBAAkB,CAAC,MAAM,EAAE,eAAe,CAAC,EACxD,KAAK,GAAG,IAAI,CAAC,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AE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,GAAG,SAAS,CAAC,CAuB1E;IAED;;;;OAIG;IACH,SAAS,CAAC,sBAAsB,CAAC,QAAQ,EAAE,oBAAoB,CAAC,MAAM,CAAC,GAAG;QACxE,WAAW,EAAE,MAAM,CAAC;QACpB,MAAM,EAAE,eAAe,EAAE,CAAC;KAC3B,CA8BA;IAED;;;;;OAKG;IACG,YAAY,CAAC,QAAQ,EAAE,oBAAoB,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAUxE;IAED;;;;;;OAMG;IACG,KAAK,CACT,QAAQ,EAAE,cAAc,CAAC,MAAM,CAAC,EAChC,OAAO,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,GAC7B,OAAO,CAAC,MAAM,EAAE,GAAG,SAAS,CAAC,CAqC/B;IAED;;;;;;;;OAQG;IACY,UAAU,CAAC,CAAC,SAAS,MAAM,MAAM,GAAG,MAAM,EACvD,QAAQ,EAAE,cAAc,CAAC,MAAM,CAAC,EAChC,OAAO,EAAE,yBAAyB,CAAC,MAAM,EAAE,CAAC,CAAC,GAC5C,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,CAiD5B;IAED;;;;;OAKG;IACa,kBAAkB,CAChC,QAAQ,EAAE,CAAC,MAAM,EAAE,oBAAoB,CAAC,MAAM,CAAC,KAAK,IAAI,EACxD,OAAO,CAAC,EAAE,uBAAuB,GAChC,MAAM,IAAI,CAEZ;IAED;;OAEG;IACa,OAAO,IAAI,IAAI,CAE9B;CACF"}
@@ -1,167 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2025 Steven Roussey <sroussey@gmail.com>
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
- import { Sqlite } from "@workglow/storage/sqlite";
7
- import { DataPortSchemaObject, FromSchema, JsonSchema, TypedArraySchemaOptions } from "@workglow/util/schema";
8
- import { BaseSqlTabularStorage } from "./BaseSqlTabularStorage";
9
- import { ClientProvidedKeysOption, KeyGenerationStrategy } from "./BaseTabularStorage";
10
- import { AnyTabularStorage, AutoGeneratedKeys, CoveringIndexQueryOptions, DeleteSearchCriteria, InsertEntity, QueryOptions, SearchCriteria, SimplifyPrimaryKey, TabularChangePayload, TabularSubscribeOptions, ValueOptionType } from "./ITabularStorage";
11
- export declare const SQLITE_TABULAR_REPOSITORY: import("@workglow/util").ServiceToken<AnyTabularStorage>;
12
- /**
13
- * A SQLite-based key-value repository implementation.
14
- * @template Schema - The schema definition for the entity
15
- * @template PrimaryKeyNames - Array of property names that form the primary key
16
- */
17
- export declare class SqliteTabularStorage<Schema extends DataPortSchemaObject, PrimaryKeyNames extends ReadonlyArray<keyof Schema["properties"]>, Entity = FromSchema<Schema, TypedArraySchemaOptions>, PrimaryKey = SimplifyPrimaryKey<Entity, PrimaryKeyNames>, Value = Omit<Entity, PrimaryKeyNames[number] & keyof Entity>, InsertType extends InsertEntity<Entity, AutoGeneratedKeys<Schema>> = InsertEntity<Entity, AutoGeneratedKeys<Schema>>> extends BaseSqlTabularStorage<Schema, PrimaryKeyNames, Entity, PrimaryKey, Value, InsertType> {
18
- /** The SQLite database instance */
19
- private db;
20
- /** Protected accessor for subclasses that need direct database access */
21
- protected get database(): Sqlite.Database;
22
- /**
23
- * Creates a new SQLite key-value repository
24
- * @param dbOrPath - Either a Database instance or a path to the SQLite database file
25
- * @param table - The name of the table to use for storage (defaults to 'tabular_store')
26
- * @param schema - Schema defining the structure of the entity
27
- * @param primaryKeyNames - Array of property names that form the primary key
28
- * @param indexes - Array of columns or column arrays to make searchable. Each string or single column creates a single-column index,
29
- * while each array creates a compound index with columns in the specified order.
30
- * @param clientProvidedKeys - How to handle client-provided values for auto-generated keys
31
- */
32
- constructor(dbOrPath: string | Sqlite.Database, table: string | undefined, schema: Schema, primaryKeyNames: PrimaryKeyNames, indexes?: readonly (keyof NoInfer<Entity> | readonly (keyof NoInfer<Entity>)[])[], clientProvidedKeys?: ClientProvidedKeysOption);
33
- /**
34
- * Override to handle SQLite's INTEGER PRIMARY KEY for auto-increment
35
- */
36
- protected constructPrimaryKeyColumns($delimiter?: string): string;
37
- /**
38
- * Creates the database table if it doesn't exist with the defined schema.
39
- * Must be called before using any other methods.
40
- */
41
- setupDatabase(): Promise<void>;
42
- /**
43
- * Convert JS values to SQLite-compatible values. Ensures booleans are stored as 0/1.
44
- */
45
- protected jsToSqlValue(column: string, value: Entity[keyof Entity]): ValueOptionType;
46
- /**
47
- * Convert SQLite values to JS values. Ensures 0/1 become booleans where schema says boolean.
48
- */
49
- protected sqlToJsValue(column: string, value: ValueOptionType): Entity[keyof Entity];
50
- /**
51
- * Maps TypeScript/JavaScript types to their SQLite column type equivalents
52
- * Uses additional schema information like minimum/maximum values, nullable status,
53
- * and string lengths to create more optimized column types.
54
- *
55
- * @param typeDef - The TypeScript/JavaScript type definition
56
- * @returns The corresponding SQLite column type
57
- */
58
- protected mapTypeToSQL(typeDef: JsonSchema): string;
59
- /**
60
- * Generates a key value for string UUID keys
61
- * Integer keys are auto-generated by SQLite's INTEGER PRIMARY KEY
62
- * @param columnName - Name of the column to generate a key for
63
- * @param strategy - The generation strategy to use
64
- * @returns The generated key value
65
- */
66
- protected generateKeyValue(columnName: string, strategy: KeyGenerationStrategy): string | number;
67
- /**
68
- * Stores a key-value pair in the database
69
- * @param entity - The entity to store (may be missing auto-generated keys)
70
- * @returns The entity with any server-generated fields updated
71
- * @emits 'put' event when successful
72
- */
73
- put(entity: InsertType): Promise<Entity>;
74
- /**
75
- * Stores multiple key-value pairs in the database in a bulk operation
76
- * @param entities - Array of entities to store (may be missing auto-generated keys)
77
- * @returns Array of entities with any server-generated fields updated
78
- * @emits 'put' event for each entity stored
79
- */
80
- putBulk(entities: InsertType[]): Promise<Entity[]>;
81
- /**
82
- * Retrieves a value from the database by its key
83
- * @param key - The primary key object to look up
84
- * @returns The stored value or undefined if not found
85
- * @emits 'get' event when successful
86
- */
87
- get(key: PrimaryKey): Promise<Entity | undefined>;
88
- /**
89
- * Deletes a key-value pair from the database
90
- * @param key - The primary key object to delete
91
- * @emits 'delete' event when successful
92
- */
93
- delete(key: PrimaryKey): Promise<void>;
94
- /**
95
- * Retrieves all entries from the database table, with optional ordering, offset, and limit.
96
- * @param options - Optional ordering, limit, and offset options
97
- * @returns Promise resolving to an array of entries or undefined if not found
98
- */
99
- getAll(options?: QueryOptions<Entity>): Promise<Entity[] | undefined>;
100
- /**
101
- * Deletes all entries from the database table
102
- * @emits 'clearall' event when successful
103
- */
104
- deleteAll(): Promise<void>;
105
- /**
106
- * Gets the total number of entries in the database table
107
- * @returns The count of entries
108
- */
109
- size(): Promise<number>;
110
- /**
111
- * Counts rows matching the specified search criteria.
112
- */
113
- count(criteria?: SearchCriteria<Entity>): Promise<number>;
114
- /**
115
- * Fetches a page of records from the repository.
116
- * @param offset - Number of records to skip
117
- * @param limit - Maximum number of records to return
118
- * @returns Array of entities or undefined if no records found
119
- */
120
- getBulk(offset: number, limit: number): Promise<Entity[] | undefined>;
121
- /**
122
- * Builds WHERE clause conditions from delete search criteria.
123
- * @param criteria - The search criteria object
124
- * @returns Object with whereClause string and params array
125
- */
126
- protected buildDeleteSearchWhere(criteria: DeleteSearchCriteria<Entity>): {
127
- whereClause: string;
128
- params: ValueOptionType[];
129
- };
130
- /**
131
- * Deletes all entries matching the specified search criteria.
132
- * Supports multiple columns with optional comparison operators.
133
- *
134
- * @param criteria - Object with column names as keys and values or SearchConditions
135
- */
136
- deleteSearch(criteria: DeleteSearchCriteria<Entity>): Promise<void>;
137
- /**
138
- * Queries entries matching the specified search criteria with optional ordering, limit, and offset.
139
- *
140
- * @param criteria - Object with column names as keys and values or SearchConditions
141
- * @param options - Optional ordering, limit, and offset options
142
- * @returns Array of matching entities or undefined if no matches found
143
- */
144
- query(criteria: SearchCriteria<Entity>, options?: QueryOptions<Entity>): Promise<Entity[] | undefined>;
145
- /**
146
- * Queries entries matching the specified search criteria, returning only the selected columns.
147
- * Requires a covering index that satisfies the criteria, orderBy, and select columns.
148
- *
149
- * @param criteria - Object with column names as keys and values or SearchConditions
150
- * @param options - Required select columns plus optional orderBy, limit, and offset
151
- * @returns Array of partial entities containing only the selected columns
152
- * @throws {CoveringIndexMissingError} when no registered index covers the query
153
- */
154
- queryIndex<K extends keyof Entity & string>(criteria: SearchCriteria<Entity>, options: CoveringIndexQueryOptions<Entity, K>): Promise<Pick<Entity, K>[]>;
155
- /**
156
- * Subscribes to changes in the repository.
157
- * NOT IMPLEMENTED for SQLite storage.
158
- *
159
- * @throws Error always - subscribeToChanges is not supported for SQLite storage
160
- */
161
- subscribeToChanges(callback: (change: TabularChangePayload<Entity>) => void, options?: TabularSubscribeOptions): () => void;
162
- /**
163
- * Destroys the repository and frees up resources.
164
- */
165
- destroy(): void;
166
- }
167
- //# sourceMappingURL=SqliteTabularStorage.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SqliteTabularStorage.d.ts","sourceRoot":"","sources":["../../src/tabular/SqliteTabularStorage.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAElD,OAAO,EACL,oBAAoB,EACpB,UAAU,EACV,UAAU,EACV,uBAAuB,EACxB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AACvF,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,yBAAyB,EACzB,oBAAoB,EACpB,YAAY,EAEZ,YAAY,EACZ,cAAc,EAEd,kBAAkB,EAClB,oBAAoB,EACpB,uBAAuB,EACvB,eAAe,EAChB,MAAM,mBAAmB,CAAC;AAG3B,eAAO,MAAM,yBAAyB,0DAErC,CAAC;AAKF;;;;GAIG;AACH,qBAAa,oBAAoB,CAC/B,MAAM,SAAS,oBAAoB,EACnC,eAAe,SAAS,aAAa,CAAC,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