@dudousxd/nestjs-durable-store-drizzle 0.28.0 → 0.29.0
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/index.cjs +4 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -2
- package/dist/index.d.ts +9 -2
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/pg/index.cjs +568 -454
- package/dist/pg/index.cjs.map +1 -1
- package/dist/pg/index.d.cts +1269 -1223
- package/dist/pg/index.d.ts +1269 -1223
- package/dist/pg/index.js +561 -450
- package/dist/pg/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -8,9 +8,16 @@ type DrizzleSqlite = BaseSQLiteDatabase<'sync' | 'async', unknown>;
|
|
|
8
8
|
* epoch-ms integers (SQLite's 64-bit integers hold them fine). For Postgres or MySQL, use the
|
|
9
9
|
* MikroORM, TypeORM or Prisma adapter.
|
|
10
10
|
*/
|
|
11
|
+
interface DrizzleStateStoreOptions {
|
|
12
|
+
/**
|
|
13
|
+
* Not supported: SQLite has no schemas. Setting it throws at construction, so a config meant for
|
|
14
|
+
* Postgres never runs against SQLite with its tables somewhere else.
|
|
15
|
+
*/
|
|
16
|
+
schema?: string | undefined;
|
|
17
|
+
}
|
|
11
18
|
declare class DrizzleStateStore implements StateStore {
|
|
12
19
|
private readonly db;
|
|
13
|
-
constructor(db: DrizzleSqlite);
|
|
20
|
+
constructor(db: DrizzleSqlite, options?: DrizzleStateStoreOptions);
|
|
14
21
|
tryAdmitSingleton(runId: string, tag: string, workflow: string, limit: number, retryWakeAt?: number): Promise<boolean>;
|
|
15
22
|
createRun(run: WorkflowRun): Promise<void>;
|
|
16
23
|
updateRun(runId: string, inputPatch: Partial<WorkflowRun>): Promise<void>;
|
|
@@ -2741,4 +2748,4 @@ declare const durableSchema: {
|
|
|
2741
2748
|
*/
|
|
2742
2749
|
declare function durableManagedTables(): string[];
|
|
2743
2750
|
|
|
2744
|
-
export { DEFAULT_NAMESPACE, DrizzleStateStore, bufferedEvents, bufferedSignals, durableManagedTables, durableSchedules, durableSchema, runAttributes, signalIds, signalWaiters, stepCheckpoints, workflowRuns };
|
|
2751
|
+
export { DEFAULT_NAMESPACE, DrizzleStateStore, type DrizzleStateStoreOptions, bufferedEvents, bufferedSignals, durableManagedTables, durableSchedules, durableSchema, runAttributes, signalIds, signalWaiters, stepCheckpoints, workflowRuns };
|
package/dist/index.d.ts
CHANGED
|
@@ -8,9 +8,16 @@ type DrizzleSqlite = BaseSQLiteDatabase<'sync' | 'async', unknown>;
|
|
|
8
8
|
* epoch-ms integers (SQLite's 64-bit integers hold them fine). For Postgres or MySQL, use the
|
|
9
9
|
* MikroORM, TypeORM or Prisma adapter.
|
|
10
10
|
*/
|
|
11
|
+
interface DrizzleStateStoreOptions {
|
|
12
|
+
/**
|
|
13
|
+
* Not supported: SQLite has no schemas. Setting it throws at construction, so a config meant for
|
|
14
|
+
* Postgres never runs against SQLite with its tables somewhere else.
|
|
15
|
+
*/
|
|
16
|
+
schema?: string | undefined;
|
|
17
|
+
}
|
|
11
18
|
declare class DrizzleStateStore implements StateStore {
|
|
12
19
|
private readonly db;
|
|
13
|
-
constructor(db: DrizzleSqlite);
|
|
20
|
+
constructor(db: DrizzleSqlite, options?: DrizzleStateStoreOptions);
|
|
14
21
|
tryAdmitSingleton(runId: string, tag: string, workflow: string, limit: number, retryWakeAt?: number): Promise<boolean>;
|
|
15
22
|
createRun(run: WorkflowRun): Promise<void>;
|
|
16
23
|
updateRun(runId: string, inputPatch: Partial<WorkflowRun>): Promise<void>;
|
|
@@ -2741,4 +2748,4 @@ declare const durableSchema: {
|
|
|
2741
2748
|
*/
|
|
2742
2749
|
declare function durableManagedTables(): string[];
|
|
2743
2750
|
|
|
2744
|
-
export { DEFAULT_NAMESPACE, DrizzleStateStore, bufferedEvents, bufferedSignals, durableManagedTables, durableSchedules, durableSchema, runAttributes, signalIds, signalWaiters, stepCheckpoints, workflowRuns };
|
|
2751
|
+
export { DEFAULT_NAMESPACE, DrizzleStateStore, type DrizzleStateStoreOptions, bufferedEvents, bufferedSignals, durableManagedTables, durableSchedules, durableSchema, runAttributes, signalIds, signalWaiters, stepCheckpoints, workflowRuns };
|
package/dist/index.js
CHANGED
|
@@ -347,8 +347,11 @@ var DrizzleStateStore = class {
|
|
|
347
347
|
__name(this, "DrizzleStateStore");
|
|
348
348
|
}
|
|
349
349
|
db;
|
|
350
|
-
constructor(db) {
|
|
350
|
+
constructor(db, options = {}) {
|
|
351
351
|
this.db = db;
|
|
352
|
+
if (options.schema !== void 0) {
|
|
353
|
+
throw new Error(`[nestjs-durable] store-drizzle: the schema option (${JSON.stringify(options.schema)}) is not supported on SQLite, which has no schemas. Remove it, or use DrizzlePgStateStore from '@dudousxd/nestjs-durable-store-drizzle/pg'.`);
|
|
354
|
+
}
|
|
352
355
|
}
|
|
353
356
|
async tryAdmitSingleton(runId, tag, workflow, limit, retryWakeAt) {
|
|
354
357
|
return this.db.transaction((tx) => {
|