@sixb/pg 0.2.0 → 0.2.1
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pg-pipeline-run-storage.d.ts","sourceRoot":"","sources":["../src/pg-pipeline-run-storage.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pg-pipeline-run-storage.d.ts","sourceRoot":"","sources":["../src/pg-pipeline-run-storage.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EACV,gBAAgB,EAChB,sBAAsB,EACtB,0BAA0B,EAC1B,2BAA2B,EAC3B,4BAA4B,EAC5B,qBAAqB,EACrB,sBAAsB,EACtB,yBAAyB,EACzB,0BAA0B,EAC1B,iBAAiB,EACjB,kBAAkB,EAClB,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,EACrB,yBAAyB,EAC1B,MAAM,oBAAoB,CAAA;AAM3B,OAAO,EAAE,KAAK,aAAa,EAAoB,MAAM,gBAAgB,CAAA;AAErE,qBAAa,oBAAqB,YAAW,kBAAkB;IAE3D,OAAO,CAAC,QAAQ,CAAC,GAAG;IACpB,OAAO,CAAC,QAAQ,CAAC,UAAU;gBADV,GAAG,EAAE,aAAa,EAClB,UAAU,EAAE,gBAAgB;IAGzC,KAAK,CAAC,KAAK,EAAE,qBAAqB,GAAG,OAAO,CAAC,iBAAiB,CAAC;YAwCvD,0BAA0B;IA8BlC,KAAK,CAAC,KAAK,EAAE,qBAAqB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAqB/D,MAAM,CAAC,KAAK,EAAE,sBAAsB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAgDjE,SAAS,CAAC,KAAK,EAAE,yBAAyB,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAkE3E,UAAU,CAAC,KAAK,EAAE,0BAA0B,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAwD7E,OAAO,CAAC,MAAM,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC;IASrF,IAAI,CAAC,KAAK,EAAE,qBAAqB,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAmDnE,uBAAuB,CAC3B,KAAK,EAAE,2BAA2B,GACjC,OAAO,CAAC,4BAA4B,CAAC;IAelC,SAAS,CAAC,KAAK,EAAE,yBAAyB,GAAG,OAAO,CAAC,0BAA0B,CAAC;CAqDvF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pg-sync-run-storage.d.ts","sourceRoot":"","sources":["../src/pg-sync-run-storage.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,gBAAgB,EAChB,kBAAkB,EAClB,uBAAuB,EACvB,wBAAwB,EACxB,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,aAAa,EACb,cAAc,EACf,MAAM,oBAAoB,CAAA;AAM3B,OAAO,EAAE,KAAK,aAAa,EAAoB,MAAM,gBAAgB,CAAA;AAErE,qBAAa,gBAAiB,YAAW,cAAc;IAEnD,OAAO,CAAC,QAAQ,CAAC,GAAG;IACpB,OAAO,CAAC,QAAQ,CAAC,UAAU;gBADV,GAAG,EAAE,aAAa,EAClB,UAAU,EAAE,gBAAgB;IAGzC,KAAK,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,aAAa,CAAC;YAgD/C,0BAA0B;IAyBlC,KAAK,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,aAAa,CAAC;IAqBvD,MAAM,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"pg-sync-run-storage.d.ts","sourceRoot":"","sources":["../src/pg-sync-run-storage.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,gBAAgB,EAChB,kBAAkB,EAClB,uBAAuB,EACvB,wBAAwB,EACxB,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,aAAa,EACb,cAAc,EACf,MAAM,oBAAoB,CAAA;AAM3B,OAAO,EAAE,KAAK,aAAa,EAAoB,MAAM,gBAAgB,CAAA;AAErE,qBAAa,gBAAiB,YAAW,cAAc;IAEnD,OAAO,CAAC,QAAQ,CAAC,GAAG;IACpB,OAAO,CAAC,QAAQ,CAAC,UAAU;gBADV,GAAG,EAAE,aAAa,EAClB,UAAU,EAAE,gBAAgB;IAGzC,KAAK,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,aAAa,CAAC;YAgD/C,0BAA0B;IAyBlC,KAAK,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,aAAa,CAAC;IAqBvD,MAAM,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,aAAa,CAAC;IA+DzD,OAAO,CAAC,MAAM,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC;IASjF,IAAI,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAwD3D,mBAAmB,CAAC,KAAK,EAAE,uBAAuB,GAAG,OAAO,CAAC,wBAAwB,CAAC;CAe7F"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sixb/pg",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "PostgreSQL storage provider for Sixb",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sixb",
|
|
@@ -40,10 +40,10 @@
|
|
|
40
40
|
"postgres": "^3.4.5"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
|
-
"@sixb/core": "0.2.
|
|
43
|
+
"@sixb/core": "0.2.1"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@sixb/core": "0.2.
|
|
46
|
+
"@sixb/core": "0.2.1",
|
|
47
47
|
"@types/bun": "latest",
|
|
48
48
|
"typescript": "^5.7.0"
|
|
49
49
|
},
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import type { JsonValue } from "@sixb/core"
|
|
2
2
|
import { parseSixbFailure, serializeSixbFailure } from "@sixb/core/internal/errors"
|
|
3
3
|
import { assertPipelineRunExecution } from "@sixb/core/internal/pipeline-run-storage-provider"
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
canFinishPipelineRun,
|
|
6
|
+
canRequeuePipelineRunAfterEnqueueFailure,
|
|
7
|
+
} from "@sixb/core/internal/storage"
|
|
5
8
|
import type { DatasetVersionRef } from "@sixb/core/lake-storage"
|
|
6
9
|
import type {
|
|
7
10
|
ExecutionStorage,
|
|
@@ -137,12 +140,7 @@ export class PgPipelineRunStorage implements PipelineRunStorage {
|
|
|
137
140
|
)
|
|
138
141
|
}
|
|
139
142
|
|
|
140
|
-
|
|
141
|
-
input.status === "failed" && input.error.code === "queue.enqueue_failed"
|
|
142
|
-
if (
|
|
143
|
-
(enqueueFailure && existing.status !== "queued") ||
|
|
144
|
-
(!enqueueFailure && existing.status !== "running")
|
|
145
|
-
) {
|
|
143
|
+
if (!canFinishPipelineRun(existing.status, input)) {
|
|
146
144
|
throw new PipelineRunError(
|
|
147
145
|
`[SixbPg] Pipeline run '${input.id}' cannot finish from status '${existing.status}'.`
|
|
148
146
|
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { JsonValue } from "@sixb/core"
|
|
2
2
|
import { parseSixbFailure, serializeSixbFailure } from "@sixb/core/internal/errors"
|
|
3
|
-
import { canRequeueSyncRunAfterEnqueueFailure } from "@sixb/core/internal/storage"
|
|
3
|
+
import { canFinishSyncRun, canRequeueSyncRunAfterEnqueueFailure } from "@sixb/core/internal/storage"
|
|
4
4
|
import { assertSyncRunExecution } from "@sixb/core/internal/sync-run-storage-provider"
|
|
5
5
|
import type {
|
|
6
6
|
ExecutionStorage,
|
|
@@ -134,12 +134,7 @@ export class PgSyncRunStorage implements SyncRunStorage {
|
|
|
134
134
|
)
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
-
|
|
138
|
-
input.status === "failed" && input.error.code === "queue.enqueue_failed"
|
|
139
|
-
if (
|
|
140
|
-
(enqueueFailure && existing.status !== "queued") ||
|
|
141
|
-
(!enqueueFailure && existing.status !== "running")
|
|
142
|
-
) {
|
|
137
|
+
if (!canFinishSyncRun(existing.status, input)) {
|
|
143
138
|
throw new SyncRunError(
|
|
144
139
|
`[SixbPg] Sync run '${input.id}' cannot finish from status '${existing.status}'.`
|
|
145
140
|
)
|