@dudousxd/nestjs-durable-store-mikro-orm 0.33.4 → 0.33.6
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 +187 -45
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +187 -45
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _mikro_orm_core from '@mikro-orm/core';
|
|
2
2
|
import { EntityRepository, EntityRepositoryType, EntitySchema, MikroORM } from '@mikro-orm/core';
|
|
3
|
-
import { StepKind, RunStatus, StateStore, WorkflowRun, RetentionPolicy, StepCheckpoint, OwnedLeaseReclaim, RunQuery, RunFacetQuery, RunFacetRow, RunValueAxis, RunValueFacetOptions, RunValueFacetRow, ScheduleRecord, ScheduleQuery, CheckpointStat, CheckpointQuery, SignalWaiter, ChildWait, BufferedSignalRow } from '@dudousxd/nestjs-durable-core';
|
|
3
|
+
import { StepKind, RunStatus, StateStore, WorkflowRun, RetentionPolicy, StepCheckpoint, StepSettlement, OwnedLeaseReclaim, RunQuery, RunFacetQuery, RunFacetRow, RunValueAxis, RunValueFacetOptions, RunValueFacetRow, ScheduleRecord, ScheduleQuery, CheckpointStat, CheckpointQuery, SignalWaiter, ChildWait, BufferedSignalRow } from '@dudousxd/nestjs-durable-core';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Custom repositories for the durable entities, so a host app can `@InjectRepository`/inject a
|
|
@@ -312,10 +312,12 @@ declare class MikroOrmStateStore implements StateStore {
|
|
|
312
312
|
pruneTerminalRuns(policy: RetentionPolicy, nowMs: number, limit: number): Promise<number>;
|
|
313
313
|
getCheckpoint(runId: string, seq: number): Promise<StepCheckpoint | null>;
|
|
314
314
|
getCheckpoints(runId: string, seqs: number[]): Promise<StepCheckpoint[]>;
|
|
315
|
+
getCheckpointsForSettle(runId: string, seqs: number[]): Promise<StepCheckpoint[]>;
|
|
315
316
|
saveCheckpoint(checkpoint: StepCheckpoint): Promise<void>;
|
|
316
317
|
saveCheckpoints(checkpoints: StepCheckpoint[]): Promise<void>;
|
|
317
318
|
saveCheckpointIfPending(checkpoint: StepCheckpoint): Promise<boolean>;
|
|
318
319
|
saveCheckpointsIfPending(checkpoints: StepCheckpoint[]): Promise<boolean[]>;
|
|
320
|
+
settleCheckpointsIfPending(settlements: StepSettlement[]): Promise<boolean[]>;
|
|
319
321
|
transaction<T>(work: (tx: {
|
|
320
322
|
raw: unknown;
|
|
321
323
|
saveCheckpoint: (cp: StepCheckpoint) => Promise<void>;
|
|
@@ -406,7 +408,9 @@ declare class MikroOrmStateStore implements StateStore {
|
|
|
406
408
|
deleteSchedule(id: string): Promise<boolean>;
|
|
407
409
|
listSchedules(query: ScheduleQuery): Promise<ScheduleRecord[]>;
|
|
408
410
|
listCheckpoints(runId: string): Promise<StepCheckpoint[]>;
|
|
411
|
+
listCheckpointsForReplay(runId: string): Promise<StepCheckpoint[]>;
|
|
409
412
|
getLatestCheckpointByName(runId: string, name: string): Promise<StepCheckpoint | undefined>;
|
|
413
|
+
hasCheckpoints(runId: string, fromSeq: number, toSeq: number, statuses: StepCheckpoint['status'][]): Promise<boolean>;
|
|
410
414
|
countCheckpoints(runId: string, fromSeq: number, toSeq: number, statuses: StepCheckpoint['status'][]): Promise<number>;
|
|
411
415
|
listCheckpointsByNamePrefix(runId: string, prefixes: string[]): Promise<StepCheckpoint[]>;
|
|
412
416
|
/** One `GROUP BY parallel_group, status, <name kind>` over the run's checkpoints — the buckets a
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _mikro_orm_core from '@mikro-orm/core';
|
|
2
2
|
import { EntityRepository, EntityRepositoryType, EntitySchema, MikroORM } from '@mikro-orm/core';
|
|
3
|
-
import { StepKind, RunStatus, StateStore, WorkflowRun, RetentionPolicy, StepCheckpoint, OwnedLeaseReclaim, RunQuery, RunFacetQuery, RunFacetRow, RunValueAxis, RunValueFacetOptions, RunValueFacetRow, ScheduleRecord, ScheduleQuery, CheckpointStat, CheckpointQuery, SignalWaiter, ChildWait, BufferedSignalRow } from '@dudousxd/nestjs-durable-core';
|
|
3
|
+
import { StepKind, RunStatus, StateStore, WorkflowRun, RetentionPolicy, StepCheckpoint, StepSettlement, OwnedLeaseReclaim, RunQuery, RunFacetQuery, RunFacetRow, RunValueAxis, RunValueFacetOptions, RunValueFacetRow, ScheduleRecord, ScheduleQuery, CheckpointStat, CheckpointQuery, SignalWaiter, ChildWait, BufferedSignalRow } from '@dudousxd/nestjs-durable-core';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Custom repositories for the durable entities, so a host app can `@InjectRepository`/inject a
|
|
@@ -312,10 +312,12 @@ declare class MikroOrmStateStore implements StateStore {
|
|
|
312
312
|
pruneTerminalRuns(policy: RetentionPolicy, nowMs: number, limit: number): Promise<number>;
|
|
313
313
|
getCheckpoint(runId: string, seq: number): Promise<StepCheckpoint | null>;
|
|
314
314
|
getCheckpoints(runId: string, seqs: number[]): Promise<StepCheckpoint[]>;
|
|
315
|
+
getCheckpointsForSettle(runId: string, seqs: number[]): Promise<StepCheckpoint[]>;
|
|
315
316
|
saveCheckpoint(checkpoint: StepCheckpoint): Promise<void>;
|
|
316
317
|
saveCheckpoints(checkpoints: StepCheckpoint[]): Promise<void>;
|
|
317
318
|
saveCheckpointIfPending(checkpoint: StepCheckpoint): Promise<boolean>;
|
|
318
319
|
saveCheckpointsIfPending(checkpoints: StepCheckpoint[]): Promise<boolean[]>;
|
|
320
|
+
settleCheckpointsIfPending(settlements: StepSettlement[]): Promise<boolean[]>;
|
|
319
321
|
transaction<T>(work: (tx: {
|
|
320
322
|
raw: unknown;
|
|
321
323
|
saveCheckpoint: (cp: StepCheckpoint) => Promise<void>;
|
|
@@ -406,7 +408,9 @@ declare class MikroOrmStateStore implements StateStore {
|
|
|
406
408
|
deleteSchedule(id: string): Promise<boolean>;
|
|
407
409
|
listSchedules(query: ScheduleQuery): Promise<ScheduleRecord[]>;
|
|
408
410
|
listCheckpoints(runId: string): Promise<StepCheckpoint[]>;
|
|
411
|
+
listCheckpointsForReplay(runId: string): Promise<StepCheckpoint[]>;
|
|
409
412
|
getLatestCheckpointByName(runId: string, name: string): Promise<StepCheckpoint | undefined>;
|
|
413
|
+
hasCheckpoints(runId: string, fromSeq: number, toSeq: number, statuses: StepCheckpoint['status'][]): Promise<boolean>;
|
|
410
414
|
countCheckpoints(runId: string, fromSeq: number, toSeq: number, statuses: StepCheckpoint['status'][]): Promise<number>;
|
|
411
415
|
listCheckpointsByNamePrefix(runId: string, prefixes: string[]): Promise<StepCheckpoint[]>;
|
|
412
416
|
/** One `GROUP BY parallel_group, status, <name kind>` over the run's checkpoints — the buckets a
|
package/dist/index.js
CHANGED
|
@@ -1299,13 +1299,32 @@ var MikroOrmStateStore = class _MikroOrmStateStore {
|
|
|
1299
1299
|
const seq = {
|
|
1300
1300
|
$in: unique.slice(at, at + 500)
|
|
1301
1301
|
};
|
|
1302
|
-
rows.push(...await em
|
|
1302
|
+
rows.push(...await selectCheckpointRows(em, {
|
|
1303
1303
|
runId,
|
|
1304
1304
|
seq
|
|
1305
1305
|
}));
|
|
1306
1306
|
}
|
|
1307
1307
|
return rows.sort((a, b) => a.seq - b.seq).map(fromCheckpointEntity);
|
|
1308
1308
|
}
|
|
1309
|
+
async getCheckpointsForSettle(runId, seqs) {
|
|
1310
|
+
if (seqs.length === 0) return [];
|
|
1311
|
+
const em = this.fork();
|
|
1312
|
+
const fields = checkpointFieldsWithoutInput(em);
|
|
1313
|
+
const unique = [
|
|
1314
|
+
...new Set(seqs)
|
|
1315
|
+
];
|
|
1316
|
+
const rows = [];
|
|
1317
|
+
for (let at = 0; at < unique.length; at += 500) {
|
|
1318
|
+
const seq = {
|
|
1319
|
+
$in: unique.slice(at, at + 500)
|
|
1320
|
+
};
|
|
1321
|
+
rows.push(...await selectCheckpointRows(em, {
|
|
1322
|
+
runId,
|
|
1323
|
+
seq
|
|
1324
|
+
}, fields));
|
|
1325
|
+
}
|
|
1326
|
+
return rows.sort((a, b) => a.seq - b.seq).map(fromCheckpointEntity);
|
|
1327
|
+
}
|
|
1309
1328
|
async saveCheckpoint(checkpoint) {
|
|
1310
1329
|
const em = this.fork();
|
|
1311
1330
|
await em.upsert(StepCheckpointEntity, toCheckpointEntity(checkpoint));
|
|
@@ -1313,11 +1332,7 @@ var MikroOrmStateStore = class _MikroOrmStateStore {
|
|
|
1313
1332
|
}
|
|
1314
1333
|
async saveCheckpoints(checkpoints) {
|
|
1315
1334
|
if (checkpoints.length === 0) return;
|
|
1316
|
-
await this.fork().transactional(
|
|
1317
|
-
for (let at = 0; at < checkpoints.length; at += 500) {
|
|
1318
|
-
await em.upsertMany(StepCheckpointEntity, checkpoints.slice(at, at + 500).map(toCheckpointRow));
|
|
1319
|
-
}
|
|
1320
|
-
});
|
|
1335
|
+
await this.fork().transactional((em) => upsertCheckpointRows(em, checkpoints.map(toCheckpointRow)));
|
|
1321
1336
|
}
|
|
1322
1337
|
async saveCheckpointIfPending(checkpoint) {
|
|
1323
1338
|
const { runId: _runId, seq: _seq, ...data } = toCheckpointEntity(checkpoint);
|
|
@@ -1334,40 +1349,14 @@ var MikroOrmStateStore = class _MikroOrmStateStore {
|
|
|
1334
1349
|
async saveCheckpointsIfPending(checkpoints) {
|
|
1335
1350
|
if (checkpoints.length === 0) return [];
|
|
1336
1351
|
return this.fork().transactional(async (em) => {
|
|
1337
|
-
const
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
seqs.add(seq);
|
|
1342
|
-
seqsByRun.set(runId, seqs);
|
|
1343
|
-
}
|
|
1344
|
-
const pending = /* @__PURE__ */ new Set();
|
|
1345
|
-
for (const [runId, seqSet] of seqsByRun) {
|
|
1346
|
-
const seqs = [
|
|
1347
|
-
...seqSet
|
|
1348
|
-
];
|
|
1349
|
-
for (let at = 0; at < seqs.length; at += 500) {
|
|
1350
|
-
const rows2 = await em.find(StepCheckpointEntity, {
|
|
1351
|
-
runId,
|
|
1352
|
-
seq: {
|
|
1353
|
-
$in: seqs.slice(at, at + 500)
|
|
1354
|
-
},
|
|
1355
|
-
status: "pending"
|
|
1356
|
-
}, {
|
|
1357
|
-
fields: [
|
|
1358
|
-
"runId",
|
|
1359
|
-
"seq"
|
|
1360
|
-
],
|
|
1361
|
-
lockMode: LockMode.PESSIMISTIC_WRITE,
|
|
1362
|
-
disableIdentityMap: true
|
|
1363
|
-
});
|
|
1364
|
-
for (const row of rows2) pending.add(key(row.runId, row.seq));
|
|
1365
|
-
}
|
|
1366
|
-
}
|
|
1352
|
+
const pending = await lockPendingCheckpoints(em, checkpoints, [
|
|
1353
|
+
"runId",
|
|
1354
|
+
"seq"
|
|
1355
|
+
]);
|
|
1367
1356
|
const wrote = [];
|
|
1368
1357
|
const writes = /* @__PURE__ */ new Map();
|
|
1369
1358
|
for (const checkpoint of checkpoints) {
|
|
1370
|
-
const k =
|
|
1359
|
+
const k = checkpointKey(checkpoint.runId, checkpoint.seq);
|
|
1371
1360
|
if (!pending.has(k)) {
|
|
1372
1361
|
wrote.push(false);
|
|
1373
1362
|
continue;
|
|
@@ -1376,11 +1365,53 @@ var MikroOrmStateStore = class _MikroOrmStateStore {
|
|
|
1376
1365
|
writes.set(k, checkpoint);
|
|
1377
1366
|
if (checkpoint.status !== "pending") pending.delete(k);
|
|
1378
1367
|
}
|
|
1379
|
-
|
|
1368
|
+
await upsertCheckpointRows(em, [
|
|
1380
1369
|
...writes.values()
|
|
1381
|
-
].map(toCheckpointRow);
|
|
1370
|
+
].map(toCheckpointRow));
|
|
1371
|
+
return wrote;
|
|
1372
|
+
});
|
|
1373
|
+
}
|
|
1374
|
+
async settleCheckpointsIfPending(settlements) {
|
|
1375
|
+
if (settlements.length === 0) return [];
|
|
1376
|
+
return this.fork().transactional(async (em) => {
|
|
1377
|
+
const pending = await lockPendingCheckpoints(em, settlements, [
|
|
1378
|
+
"runId",
|
|
1379
|
+
"seq",
|
|
1380
|
+
"name",
|
|
1381
|
+
"kind",
|
|
1382
|
+
"stepId",
|
|
1383
|
+
"attempts"
|
|
1384
|
+
]);
|
|
1385
|
+
const wrote = [];
|
|
1386
|
+
const rows = [];
|
|
1387
|
+
for (const s of settlements) {
|
|
1388
|
+
const k = checkpointKey(s.runId, s.seq);
|
|
1389
|
+
const row = pending.get(k);
|
|
1390
|
+
wrote.push(row !== void 0);
|
|
1391
|
+
if (!row) continue;
|
|
1392
|
+
pending.delete(k);
|
|
1393
|
+
rows.push({
|
|
1394
|
+
runId: row.runId,
|
|
1395
|
+
seq: row.seq,
|
|
1396
|
+
name: row.name,
|
|
1397
|
+
kind: row.kind,
|
|
1398
|
+
stepId: row.stepId,
|
|
1399
|
+
attempts: row.attempts,
|
|
1400
|
+
status: s.status,
|
|
1401
|
+
output: s.output ?? null,
|
|
1402
|
+
error: s.error ?? null,
|
|
1403
|
+
events: s.events ?? null,
|
|
1404
|
+
startedAt: s.startedAt,
|
|
1405
|
+
finishedAt: s.finishedAt
|
|
1406
|
+
});
|
|
1407
|
+
}
|
|
1382
1408
|
for (let at = 0; at < rows.length; at += 500) {
|
|
1383
|
-
await em.
|
|
1409
|
+
await em.createQueryBuilder(StepCheckpointEntity).insert(rows.slice(at, at + 500)).onConflict([
|
|
1410
|
+
"runId",
|
|
1411
|
+
"seq"
|
|
1412
|
+
]).merge([
|
|
1413
|
+
...SETTLED_FIELDS
|
|
1414
|
+
]).execute();
|
|
1384
1415
|
}
|
|
1385
1416
|
return wrote;
|
|
1386
1417
|
});
|
|
@@ -1898,14 +1929,33 @@ var MikroOrmStateStore = class _MikroOrmStateStore {
|
|
|
1898
1929
|
return (await qb.getResultList()).map(fromScheduleEntity);
|
|
1899
1930
|
}
|
|
1900
1931
|
async listCheckpoints(runId) {
|
|
1932
|
+
const rows = await selectCheckpointRows(this.fork(), {
|
|
1933
|
+
runId
|
|
1934
|
+
});
|
|
1935
|
+
return rows.map(fromCheckpointEntity);
|
|
1936
|
+
}
|
|
1937
|
+
async listCheckpointsForReplay(runId) {
|
|
1901
1938
|
const em = this.fork();
|
|
1902
|
-
const rows = await em
|
|
1939
|
+
const rows = await selectCheckpointRows(em, {
|
|
1903
1940
|
runId
|
|
1904
|
-
},
|
|
1905
|
-
|
|
1906
|
-
|
|
1941
|
+
}, checkpointFieldsWithoutInput(em));
|
|
1942
|
+
const open = rows.filter((row) => row.status !== "completed").map((row) => row.seq);
|
|
1943
|
+
if (open.length > 0) {
|
|
1944
|
+
const inputs = /* @__PURE__ */ new Map();
|
|
1945
|
+
for (let at = 0; at < open.length; at += 500) {
|
|
1946
|
+
const found = await selectCheckpointRows(em, {
|
|
1947
|
+
runId,
|
|
1948
|
+
seq: {
|
|
1949
|
+
$in: open.slice(at, at + 500)
|
|
1950
|
+
}
|
|
1951
|
+
}, [
|
|
1952
|
+
"seq",
|
|
1953
|
+
"input"
|
|
1954
|
+
]);
|
|
1955
|
+
for (const row of found) inputs.set(row.seq, row.input);
|
|
1907
1956
|
}
|
|
1908
|
-
|
|
1957
|
+
for (const row of rows) if (inputs.has(row.seq)) row.input = inputs.get(row.seq);
|
|
1958
|
+
}
|
|
1909
1959
|
return rows.map(fromCheckpointEntity);
|
|
1910
1960
|
}
|
|
1911
1961
|
async getLatestCheckpointByName(runId, name) {
|
|
@@ -1920,6 +1970,27 @@ var MikroOrmStateStore = class _MikroOrmStateStore {
|
|
|
1920
1970
|
});
|
|
1921
1971
|
return entity ? fromCheckpointEntity(entity) : void 0;
|
|
1922
1972
|
}
|
|
1973
|
+
async hasCheckpoints(runId, fromSeq, toSeq, statuses) {
|
|
1974
|
+
if (statuses.length === 0) return false;
|
|
1975
|
+
const row = await this.fork().findOne(StepCheckpointEntity, {
|
|
1976
|
+
runId,
|
|
1977
|
+
seq: {
|
|
1978
|
+
$gte: fromSeq,
|
|
1979
|
+
$lte: toSeq
|
|
1980
|
+
},
|
|
1981
|
+
status: {
|
|
1982
|
+
$in: statuses
|
|
1983
|
+
}
|
|
1984
|
+
}, {
|
|
1985
|
+
fields: [
|
|
1986
|
+
"seq"
|
|
1987
|
+
],
|
|
1988
|
+
orderBy: {
|
|
1989
|
+
seq: "desc"
|
|
1990
|
+
}
|
|
1991
|
+
});
|
|
1992
|
+
return row !== null;
|
|
1993
|
+
}
|
|
1923
1994
|
async countCheckpoints(runId, fromSeq, toSeq, statuses) {
|
|
1924
1995
|
if (statuses.length === 0) return 0;
|
|
1925
1996
|
return this.fork().count(StepCheckpointEntity, {
|
|
@@ -2330,6 +2401,77 @@ function aggregateDateReader(em) {
|
|
|
2330
2401
|
};
|
|
2331
2402
|
}
|
|
2332
2403
|
__name(aggregateDateReader, "aggregateDateReader");
|
|
2404
|
+
function checkpointFieldsWithoutInput(em) {
|
|
2405
|
+
return Object.keys(em.getMetadata().get(StepCheckpointEntity).properties).filter((name) => name !== "input");
|
|
2406
|
+
}
|
|
2407
|
+
__name(checkpointFieldsWithoutInput, "checkpointFieldsWithoutInput");
|
|
2408
|
+
async function selectCheckpointRows(em, where, fields) {
|
|
2409
|
+
const query = em.createQueryBuilder(StepCheckpointEntity);
|
|
2410
|
+
if (fields) query.select(fields);
|
|
2411
|
+
const rows = await query.where(where).orderBy({
|
|
2412
|
+
seq: "asc"
|
|
2413
|
+
}).execute("all", true);
|
|
2414
|
+
const platform = em.getPlatform();
|
|
2415
|
+
const custom = Object.values(em.getMetadata().get(StepCheckpointEntity).properties).filter((prop) => prop.customType);
|
|
2416
|
+
for (const row of rows) {
|
|
2417
|
+
for (const prop of custom) {
|
|
2418
|
+
const value = row[prop.name];
|
|
2419
|
+
if (value != null) row[prop.name] = prop.customType?.convertToJSValue(value, platform);
|
|
2420
|
+
}
|
|
2421
|
+
}
|
|
2422
|
+
return rows;
|
|
2423
|
+
}
|
|
2424
|
+
__name(selectCheckpointRows, "selectCheckpointRows");
|
|
2425
|
+
var SETTLED_FIELDS = [
|
|
2426
|
+
"status",
|
|
2427
|
+
"output",
|
|
2428
|
+
"error",
|
|
2429
|
+
"events",
|
|
2430
|
+
"startedAt",
|
|
2431
|
+
"finishedAt"
|
|
2432
|
+
];
|
|
2433
|
+
var checkpointKey = /* @__PURE__ */ __name((runId, seq) => `${runId}\0${seq}`, "checkpointKey");
|
|
2434
|
+
async function lockPendingCheckpoints(em, entries, fields) {
|
|
2435
|
+
const seqsByRun = /* @__PURE__ */ new Map();
|
|
2436
|
+
for (const { runId, seq } of entries) {
|
|
2437
|
+
const seqs = seqsByRun.get(runId) ?? /* @__PURE__ */ new Set();
|
|
2438
|
+
seqs.add(seq);
|
|
2439
|
+
seqsByRun.set(runId, seqs);
|
|
2440
|
+
}
|
|
2441
|
+
const pending = /* @__PURE__ */ new Map();
|
|
2442
|
+
for (const [runId, seqSet] of seqsByRun) {
|
|
2443
|
+
const seqs = [
|
|
2444
|
+
...seqSet
|
|
2445
|
+
];
|
|
2446
|
+
for (let at = 0; at < seqs.length; at += 500) {
|
|
2447
|
+
const rows = await em.find(StepCheckpointEntity, {
|
|
2448
|
+
runId,
|
|
2449
|
+
seq: {
|
|
2450
|
+
$in: seqs.slice(at, at + 500)
|
|
2451
|
+
},
|
|
2452
|
+
status: "pending"
|
|
2453
|
+
}, {
|
|
2454
|
+
fields,
|
|
2455
|
+
lockMode: LockMode.PESSIMISTIC_WRITE,
|
|
2456
|
+
disableIdentityMap: true
|
|
2457
|
+
});
|
|
2458
|
+
for (const row of rows) pending.set(checkpointKey(row.runId, row.seq), row);
|
|
2459
|
+
}
|
|
2460
|
+
}
|
|
2461
|
+
return pending;
|
|
2462
|
+
}
|
|
2463
|
+
__name(lockPendingCheckpoints, "lockPendingCheckpoints");
|
|
2464
|
+
async function upsertCheckpointRows(em, rows) {
|
|
2465
|
+
for (let at = 0; at < rows.length; at += 500) {
|
|
2466
|
+
await em.createQueryBuilder(StepCheckpointEntity).insert(rows.slice(at, at + 500).map((row) => ({
|
|
2467
|
+
...row
|
|
2468
|
+
}))).onConflict([
|
|
2469
|
+
"runId",
|
|
2470
|
+
"seq"
|
|
2471
|
+
]).merge().execute();
|
|
2472
|
+
}
|
|
2473
|
+
}
|
|
2474
|
+
__name(upsertCheckpointRows, "upsertCheckpointRows");
|
|
2333
2475
|
function toCheckpointRow(cp) {
|
|
2334
2476
|
const row = toCheckpointEntity(cp);
|
|
2335
2477
|
for (const key of [
|