@pgxsinkit/client 0.1.49 → 0.1.50
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/boot-report.d.ts +76 -0
- package/dist/boot-report.d.ts.map +1 -1
- package/dist/index.d.ts +56 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1036 -286
- package/dist/index.js.map +13 -12
- package/dist/local-store.d.ts +58 -0
- package/dist/local-store.d.ts.map +1 -1
- package/dist/local-tables.d.ts +340 -0
- package/dist/local-tables.d.ts.map +1 -1
- package/dist/mutation.d.ts +36 -0
- package/dist/mutation.d.ts.map +1 -1
- package/dist/mutations-api.d.ts +82 -0
- package/dist/mutations-api.d.ts.map +1 -0
- package/dist/schema.d.ts +62 -0
- package/dist/schema.d.ts.map +1 -1
- package/dist/worker/attach-sync-client.d.ts.map +1 -1
- package/dist/worker/define-sync-worker.d.ts.map +1 -1
- package/dist/worker/protocol.d.ts +44 -1
- package/dist/worker/protocol.d.ts.map +1 -1
- package/package.json +2 -2
- package/skills/core/SKILL.md +1 -1
- package/skills/operating/SKILL.md +1 -1
- package/src/boot-report.ts +108 -0
- package/src/index.ts +555 -136
- package/src/local-store.ts +150 -3
- package/src/local-tables.ts +49 -1
- package/src/mutation.ts +256 -15
- package/src/mutations-api.ts +310 -0
- package/src/schema.ts +406 -193
- package/src/worker/attach-sync-client.ts +114 -5
- package/src/worker/define-sync-worker.ts +65 -4
- package/src/worker/protocol.ts +38 -1
package/dist/local-store.d.ts
CHANGED
|
@@ -34,6 +34,64 @@ export declare function writeLazyGroupActivation(db: MutationDb, registry: SyncT
|
|
|
34
34
|
export declare function clearLazyGroupActivation(db: MutationDb, registry: SyncTableRegistry, groupKey: string): Promise<void>;
|
|
35
35
|
/** Stamp the local store with the fingerprint it is now provisioned under. */
|
|
36
36
|
export declare function writeStoredRegistryFingerprint(db: MutationDb, registry: SyncTableRegistry, fingerprint: string): Promise<void>;
|
|
37
|
+
/**
|
|
38
|
+
* The durable-schema fingerprint the local store was last provisioned under (slice 3 / proposal §3), or null
|
|
39
|
+
* when unstamped (a legacy store, or a store whose durable schema was never executed under this feature).
|
|
40
|
+
* Follows the raw-seam read shape of {@link readStoredRegistryFingerprint}.
|
|
41
|
+
*/
|
|
42
|
+
export declare function readStoredLocalSchemaFingerprint(db: MutationDb, registry: SyncTableRegistry): Promise<string | null>;
|
|
43
|
+
/**
|
|
44
|
+
* Stamp the durable-schema fingerprint the store is now provisioned under (slice 3). Called ONLY after a
|
|
45
|
+
* successful durable-schema exec — every full durable exec (boot fast-path miss, reconcile rebuild,
|
|
46
|
+
* `dropReadCache`) and its stamp travel together, so the fingerprint never claims a schema that was not run.
|
|
47
|
+
*/
|
|
48
|
+
export declare function writeStoredLocalSchemaFingerprint(db: MutationDb, registry: SyncTableRegistry, fingerprint: string): Promise<void>;
|
|
49
|
+
/**
|
|
50
|
+
* The durable recovery-required marker (warm-persisted-store-startup slice 2 / proposal §1). Its
|
|
51
|
+
* `pgxsinkit_local_meta` value is `"true"` while a `sending` journal row MAY have been committed since the
|
|
52
|
+
* last clean settle, and `"false"` once pgxsinkit has PROVEN no `sending` row remains. Absent = a
|
|
53
|
+
* pre-feature (legacy) store: run one conservative legacy recovery pass, then initialize the marker.
|
|
54
|
+
*
|
|
55
|
+
* The invariant the whole slice protects: **the marker is never `"false"` while a committed `sending`
|
|
56
|
+
* journal row exists.** It is upheld by marker-first ordering — {@link writeMutationRecoveryRequired}(true)
|
|
57
|
+
* is awaited (and auto-commits) strictly BEFORE the first pending→sending transition of a dirty epoch — and
|
|
58
|
+
* by the self-verifying clear ({@link clearMutationRecoveryMarkerIfSettled}), which only writes `"false"`
|
|
59
|
+
* when NOT EXISTS any `sending` row across every writable journal.
|
|
60
|
+
*/
|
|
61
|
+
export declare const MUTATION_RECOVERY_REQUIRED_KEY = "mutation_recovery_required";
|
|
62
|
+
/**
|
|
63
|
+
* Read the durable recovery-required marker: `true`/`false` for the stored value, or `null` when the key is
|
|
64
|
+
* absent (a legacy/pre-feature store). Follows the raw-seam read shape of
|
|
65
|
+
* {@link readStoredRegistryFingerprint}.
|
|
66
|
+
*
|
|
67
|
+
* FIX 4 (fail closed): the marker is a SAFETY marker — `false` is the ONLY value that skips recovery, so any
|
|
68
|
+
* present value that is not exactly `"true"` or `"false"` (corruption, a future encoding, stray whitespace, a
|
|
69
|
+
* partial/manual edit) must NOT be decoded as clean. It is logged on the debug rail and treated as `true`
|
|
70
|
+
* (recovery required); the recovery pass then rewrites a well-formed value.
|
|
71
|
+
*/
|
|
72
|
+
export declare function readMutationRecoveryRequired(db: MutationDb, registry: SyncTableRegistry): Promise<boolean | null>;
|
|
73
|
+
/**
|
|
74
|
+
* Upsert the durable recovery-required marker to `"true"`/`"false"` unconditionally. The `true` write is the
|
|
75
|
+
* marker-first SET (awaited before the first `sending` transition of a dirty epoch); the `false` write
|
|
76
|
+
* initializes an absent (legacy) marker AFTER a legacy recovery pass has guaranteed no `sending` row remains.
|
|
77
|
+
*/
|
|
78
|
+
export declare function writeMutationRecoveryRequired(db: MutationDb, registry: SyncTableRegistry, required: boolean): Promise<void>;
|
|
79
|
+
/**
|
|
80
|
+
* Self-verifying clear (proposal §1 rule 2): set the marker to `"false"` in ONE guarded, Drizzle-composed
|
|
81
|
+
* statement — but only where NOT EXISTS any `sending` row in ANY writable journal (the EXISTS-union is built
|
|
82
|
+
* from the registry's journal Drizzle objects via {@link getJournalTable}). Correct regardless of JS
|
|
83
|
+
* bookkeeping: a concurrent enqueue that committed a `sending` row makes the guard fail, so the marker stays
|
|
84
|
+
* `"true"`. Returns `{ cleared }` from the statement's affected-row count (PGlite reports `affectedRows`) —
|
|
85
|
+
* `true` when the guard passed (an existing marker row flipped/held at `"false"`), `false` when a `sending`
|
|
86
|
+
* row blocked it OR no marker row exists yet. Off the boot path AND at the end of a boot recovery pass.
|
|
87
|
+
*
|
|
88
|
+
* The marker row must already exist for this UPDATE to take effect; the absent-store INIT is a distinct
|
|
89
|
+
* unconditional {@link writeMutationRecoveryRequired}(false) after the legacy pass (a pure guarded UPDATE
|
|
90
|
+
* cannot create the row, and drizzle-rc.4 cannot render a from-less guarded insert-select).
|
|
91
|
+
*/
|
|
92
|
+
export declare function clearMutationRecoveryMarkerIfSettled(db: MutationDb, registry: SyncTableRegistry): Promise<{
|
|
93
|
+
cleared: boolean;
|
|
94
|
+
}>;
|
|
37
95
|
/**
|
|
38
96
|
* Reconcile the local store against the current registry fingerprint (ADR-0006). A fresh
|
|
39
97
|
* (unstamped) store is stamped; an unchanged fingerprint is a no-op. On a change, the read
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-store.d.ts","sourceRoot":"","sources":["../src/local-store.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"local-store.d.ts","sourceRoot":"","sources":["../src/local-store.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAIxF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAe7C;;;;;GAKG;AAEH,sFAAsF;AACtF,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,SAAS,GAAG,UAAU,CAAC;IAC/B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,eAAe,EAAE,MAAM,CAAC;IACxB,qFAAqF;IACrF,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,6EAA6E;AAC7E,UAAU,uBAAuB;IAC/B,eAAe,EAAE,MAAM,CAAC;IACxB,iBAAiB,EAAE,MAAM,OAAO,CAAC,mBAAmB,CAAC,CAAC;CACvD;AAED,iGAAiG;AACjG,wBAAsB,6BAA6B,CACjD,EAAE,EAAE,UAAU,EACd,QAAQ,EAAE,iBAAiB,GAC1B,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAW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AC,CAEf;AAOD;;;;;;;;;;;;GAYG;AACH,wBAAsB,oCAAoC,CACxD,EAAE,EAAE,UAAU,EACd,QAAQ,EAAE,iBAAiB,GAC1B,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,CAkB/B;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,0BAA0B,CAAC,SAAS,SAAS,iBAAiB,EAAE,IAAI,EAAE;IAC1F,EAAE,EAAE,UAAU,CAAC;IACf,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,EAAE,uBAAuB,CAAC;IACjC,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,sBAAsB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1E,GAAG,OAAO,CAAC,sBAAsB,GAAG,IAAI,CAAC,CAezC"}
|
package/dist/local-tables.d.ts
CHANGED
|
@@ -701,6 +701,346 @@ export interface ApplyTarget {
|
|
|
701
701
|
* `getSyncedLocalTable`, PKs via `getLocalSyncedTablePrimaryKeyColumns`, types via `deriveSyncColumnTypes`.
|
|
702
702
|
*/
|
|
703
703
|
export declare function resolveApplyTarget<TRegistry extends SyncTableRegistry, TKey extends string & keyof TRegistry>(registry: TRegistry, tableKey: TKey): ApplyTarget;
|
|
704
|
+
declare const allMutationsShape: PgViewWithSelection<"pgxsinkit_all_mutations", true, {
|
|
705
|
+
tableKey: import("drizzle-orm/pg-core").PgBuildColumn<"pgxsinkit_all_mutations", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>>, {
|
|
706
|
+
name: string;
|
|
707
|
+
tableName: "pgxsinkit_all_mutations";
|
|
708
|
+
dataType: "string";
|
|
709
|
+
data: string;
|
|
710
|
+
driverParam: string;
|
|
711
|
+
notNull: true;
|
|
712
|
+
hasDefault: false;
|
|
713
|
+
isPrimaryKey: false;
|
|
714
|
+
isAutoincrement: false;
|
|
715
|
+
hasRuntimeDefault: false;
|
|
716
|
+
enumValues: undefined;
|
|
717
|
+
identity: undefined;
|
|
718
|
+
generated: undefined;
|
|
719
|
+
}>;
|
|
720
|
+
mutationId: import("drizzle-orm/pg-core").PgBuildColumn<"pgxsinkit_all_mutations", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgUUIDBuilder>, {
|
|
721
|
+
name: string;
|
|
722
|
+
tableName: "pgxsinkit_all_mutations";
|
|
723
|
+
dataType: "string uuid";
|
|
724
|
+
data: string;
|
|
725
|
+
driverParam: string;
|
|
726
|
+
notNull: true;
|
|
727
|
+
hasDefault: false;
|
|
728
|
+
isPrimaryKey: false;
|
|
729
|
+
isAutoincrement: false;
|
|
730
|
+
hasRuntimeDefault: false;
|
|
731
|
+
enumValues: undefined;
|
|
732
|
+
identity: undefined;
|
|
733
|
+
generated: undefined;
|
|
734
|
+
}>;
|
|
735
|
+
entityKeyJson: import("drizzle-orm/pg-core").PgBuildColumn<"pgxsinkit_all_mutations", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>>, {
|
|
736
|
+
name: string;
|
|
737
|
+
tableName: "pgxsinkit_all_mutations";
|
|
738
|
+
dataType: "string";
|
|
739
|
+
data: string;
|
|
740
|
+
driverParam: string;
|
|
741
|
+
notNull: true;
|
|
742
|
+
hasDefault: false;
|
|
743
|
+
isPrimaryKey: false;
|
|
744
|
+
isAutoincrement: false;
|
|
745
|
+
hasRuntimeDefault: false;
|
|
746
|
+
enumValues: undefined;
|
|
747
|
+
identity: undefined;
|
|
748
|
+
generated: undefined;
|
|
749
|
+
}>;
|
|
750
|
+
mutationSeq: import("drizzle-orm/pg-core").PgBuildColumn<"pgxsinkit_all_mutations", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgIntegerBuilder>, {
|
|
751
|
+
name: string;
|
|
752
|
+
tableName: "pgxsinkit_all_mutations";
|
|
753
|
+
dataType: "number int32";
|
|
754
|
+
data: number;
|
|
755
|
+
driverParam: string | number;
|
|
756
|
+
notNull: true;
|
|
757
|
+
hasDefault: false;
|
|
758
|
+
isPrimaryKey: false;
|
|
759
|
+
isAutoincrement: false;
|
|
760
|
+
hasRuntimeDefault: false;
|
|
761
|
+
enumValues: undefined;
|
|
762
|
+
identity: undefined;
|
|
763
|
+
generated: undefined;
|
|
764
|
+
}>;
|
|
765
|
+
mutationKind: import("drizzle-orm/pg-core").PgBuildColumn<"pgxsinkit_all_mutations", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgVarcharBuilder<[string, ...string[]]>>, {
|
|
766
|
+
name: string;
|
|
767
|
+
tableName: "pgxsinkit_all_mutations";
|
|
768
|
+
dataType: "string";
|
|
769
|
+
data: string;
|
|
770
|
+
driverParam: string;
|
|
771
|
+
notNull: true;
|
|
772
|
+
hasDefault: false;
|
|
773
|
+
isPrimaryKey: false;
|
|
774
|
+
isAutoincrement: false;
|
|
775
|
+
hasRuntimeDefault: false;
|
|
776
|
+
enumValues: undefined;
|
|
777
|
+
identity: undefined;
|
|
778
|
+
generated: undefined;
|
|
779
|
+
}>;
|
|
780
|
+
status: import("drizzle-orm/pg-core").PgBuildColumn<"pgxsinkit_all_mutations", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgVarcharBuilder<[string, ...string[]]>>, {
|
|
781
|
+
name: string;
|
|
782
|
+
tableName: "pgxsinkit_all_mutations";
|
|
783
|
+
dataType: "string";
|
|
784
|
+
data: string;
|
|
785
|
+
driverParam: string;
|
|
786
|
+
notNull: true;
|
|
787
|
+
hasDefault: false;
|
|
788
|
+
isPrimaryKey: false;
|
|
789
|
+
isAutoincrement: false;
|
|
790
|
+
hasRuntimeDefault: false;
|
|
791
|
+
enumValues: undefined;
|
|
792
|
+
identity: undefined;
|
|
793
|
+
generated: undefined;
|
|
794
|
+
}>;
|
|
795
|
+
registryVersion: import("drizzle-orm/pg-core").PgBuildColumn<"pgxsinkit_all_mutations", import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>, {
|
|
796
|
+
name: string;
|
|
797
|
+
tableName: "pgxsinkit_all_mutations";
|
|
798
|
+
dataType: "string";
|
|
799
|
+
data: string;
|
|
800
|
+
driverParam: string;
|
|
801
|
+
notNull: false;
|
|
802
|
+
hasDefault: false;
|
|
803
|
+
isPrimaryKey: false;
|
|
804
|
+
isAutoincrement: false;
|
|
805
|
+
hasRuntimeDefault: false;
|
|
806
|
+
enumValues: undefined;
|
|
807
|
+
identity: undefined;
|
|
808
|
+
generated: undefined;
|
|
809
|
+
}>;
|
|
810
|
+
baseServerVersion: import("drizzle-orm/pg-core").PgBuildColumn<"pgxsinkit_all_mutations", import("drizzle-orm/pg-core").PgCustomColumnBuilder<{
|
|
811
|
+
dataType: 'custom';
|
|
812
|
+
data: string;
|
|
813
|
+
driverParam: string;
|
|
814
|
+
}>, {
|
|
815
|
+
name: string;
|
|
816
|
+
tableName: "pgxsinkit_all_mutations";
|
|
817
|
+
dataType: "custom";
|
|
818
|
+
data: string;
|
|
819
|
+
driverParam: string;
|
|
820
|
+
notNull: false;
|
|
821
|
+
hasDefault: false;
|
|
822
|
+
isPrimaryKey: false;
|
|
823
|
+
isAutoincrement: false;
|
|
824
|
+
hasRuntimeDefault: false;
|
|
825
|
+
enumValues: undefined;
|
|
826
|
+
identity: undefined;
|
|
827
|
+
generated: undefined;
|
|
828
|
+
}>;
|
|
829
|
+
writeUnit: import("drizzle-orm/pg-core").PgBuildColumn<"pgxsinkit_all_mutations", import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>, {
|
|
830
|
+
name: string;
|
|
831
|
+
tableName: "pgxsinkit_all_mutations";
|
|
832
|
+
dataType: "string";
|
|
833
|
+
data: string;
|
|
834
|
+
driverParam: string;
|
|
835
|
+
notNull: false;
|
|
836
|
+
hasDefault: false;
|
|
837
|
+
isPrimaryKey: false;
|
|
838
|
+
isAutoincrement: false;
|
|
839
|
+
hasRuntimeDefault: false;
|
|
840
|
+
enumValues: undefined;
|
|
841
|
+
identity: undefined;
|
|
842
|
+
generated: undefined;
|
|
843
|
+
}>;
|
|
844
|
+
writeMode: import("drizzle-orm/pg-core").PgBuildColumn<"pgxsinkit_all_mutations", import("drizzle-orm/pg-core").PgVarcharBuilder<[string, ...string[]]>, {
|
|
845
|
+
name: string;
|
|
846
|
+
tableName: "pgxsinkit_all_mutations";
|
|
847
|
+
dataType: "string";
|
|
848
|
+
data: string;
|
|
849
|
+
driverParam: string;
|
|
850
|
+
notNull: false;
|
|
851
|
+
hasDefault: false;
|
|
852
|
+
isPrimaryKey: false;
|
|
853
|
+
isAutoincrement: false;
|
|
854
|
+
hasRuntimeDefault: false;
|
|
855
|
+
enumValues: undefined;
|
|
856
|
+
identity: undefined;
|
|
857
|
+
generated: undefined;
|
|
858
|
+
}>;
|
|
859
|
+
attemptCount: import("drizzle-orm/pg-core").PgBuildColumn<"pgxsinkit_all_mutations", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgIntegerBuilder>, {
|
|
860
|
+
name: string;
|
|
861
|
+
tableName: "pgxsinkit_all_mutations";
|
|
862
|
+
dataType: "number int32";
|
|
863
|
+
data: number;
|
|
864
|
+
driverParam: string | number;
|
|
865
|
+
notNull: true;
|
|
866
|
+
hasDefault: false;
|
|
867
|
+
isPrimaryKey: false;
|
|
868
|
+
isAutoincrement: false;
|
|
869
|
+
hasRuntimeDefault: false;
|
|
870
|
+
enumValues: undefined;
|
|
871
|
+
identity: undefined;
|
|
872
|
+
generated: undefined;
|
|
873
|
+
}>;
|
|
874
|
+
lastError: import("drizzle-orm/pg-core").PgBuildColumn<"pgxsinkit_all_mutations", import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>, {
|
|
875
|
+
name: string;
|
|
876
|
+
tableName: "pgxsinkit_all_mutations";
|
|
877
|
+
dataType: "string";
|
|
878
|
+
data: string;
|
|
879
|
+
driverParam: string;
|
|
880
|
+
notNull: false;
|
|
881
|
+
hasDefault: false;
|
|
882
|
+
isPrimaryKey: false;
|
|
883
|
+
isAutoincrement: false;
|
|
884
|
+
hasRuntimeDefault: false;
|
|
885
|
+
enumValues: undefined;
|
|
886
|
+
identity: undefined;
|
|
887
|
+
generated: undefined;
|
|
888
|
+
}>;
|
|
889
|
+
lastHttpStatus: import("drizzle-orm/pg-core").PgBuildColumn<"pgxsinkit_all_mutations", import("drizzle-orm/pg-core").PgIntegerBuilder, {
|
|
890
|
+
name: string;
|
|
891
|
+
tableName: "pgxsinkit_all_mutations";
|
|
892
|
+
dataType: "number int32";
|
|
893
|
+
data: number;
|
|
894
|
+
driverParam: string | number;
|
|
895
|
+
notNull: false;
|
|
896
|
+
hasDefault: false;
|
|
897
|
+
isPrimaryKey: false;
|
|
898
|
+
isAutoincrement: false;
|
|
899
|
+
hasRuntimeDefault: false;
|
|
900
|
+
enumValues: undefined;
|
|
901
|
+
identity: undefined;
|
|
902
|
+
generated: undefined;
|
|
903
|
+
}>;
|
|
904
|
+
conflictReason: import("drizzle-orm/pg-core").PgBuildColumn<"pgxsinkit_all_mutations", import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>, {
|
|
905
|
+
name: string;
|
|
906
|
+
tableName: "pgxsinkit_all_mutations";
|
|
907
|
+
dataType: "string";
|
|
908
|
+
data: string;
|
|
909
|
+
driverParam: string;
|
|
910
|
+
notNull: false;
|
|
911
|
+
hasDefault: false;
|
|
912
|
+
isPrimaryKey: false;
|
|
913
|
+
isAutoincrement: false;
|
|
914
|
+
hasRuntimeDefault: false;
|
|
915
|
+
enumValues: undefined;
|
|
916
|
+
identity: undefined;
|
|
917
|
+
generated: undefined;
|
|
918
|
+
}>;
|
|
919
|
+
serverUpdatedAtUs: import("drizzle-orm/pg-core").PgBuildColumn<"pgxsinkit_all_mutations", import("drizzle-orm/pg-core").PgCustomColumnBuilder<{
|
|
920
|
+
dataType: 'custom';
|
|
921
|
+
data: string;
|
|
922
|
+
driverParam: string;
|
|
923
|
+
}>, {
|
|
924
|
+
name: string;
|
|
925
|
+
tableName: "pgxsinkit_all_mutations";
|
|
926
|
+
dataType: "custom";
|
|
927
|
+
data: string;
|
|
928
|
+
driverParam: string;
|
|
929
|
+
notNull: false;
|
|
930
|
+
hasDefault: false;
|
|
931
|
+
isPrimaryKey: false;
|
|
932
|
+
isAutoincrement: false;
|
|
933
|
+
hasRuntimeDefault: false;
|
|
934
|
+
enumValues: undefined;
|
|
935
|
+
identity: undefined;
|
|
936
|
+
generated: undefined;
|
|
937
|
+
}>;
|
|
938
|
+
enqueuedAtUs: import("drizzle-orm/pg-core").PgBuildColumn<"pgxsinkit_all_mutations", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgCustomColumnBuilder<{
|
|
939
|
+
dataType: 'custom';
|
|
940
|
+
data: string;
|
|
941
|
+
driverParam: string;
|
|
942
|
+
}>>, {
|
|
943
|
+
name: string;
|
|
944
|
+
tableName: "pgxsinkit_all_mutations";
|
|
945
|
+
dataType: "custom";
|
|
946
|
+
data: string;
|
|
947
|
+
driverParam: string;
|
|
948
|
+
notNull: true;
|
|
949
|
+
hasDefault: false;
|
|
950
|
+
isPrimaryKey: false;
|
|
951
|
+
isAutoincrement: false;
|
|
952
|
+
hasRuntimeDefault: false;
|
|
953
|
+
enumValues: undefined;
|
|
954
|
+
identity: undefined;
|
|
955
|
+
generated: undefined;
|
|
956
|
+
}>;
|
|
957
|
+
nextRetryAtUs: import("drizzle-orm/pg-core").PgBuildColumn<"pgxsinkit_all_mutations", import("drizzle-orm/pg-core").PgCustomColumnBuilder<{
|
|
958
|
+
dataType: 'custom';
|
|
959
|
+
data: string;
|
|
960
|
+
driverParam: string;
|
|
961
|
+
}>, {
|
|
962
|
+
name: string;
|
|
963
|
+
tableName: "pgxsinkit_all_mutations";
|
|
964
|
+
dataType: "custom";
|
|
965
|
+
data: string;
|
|
966
|
+
driverParam: string;
|
|
967
|
+
notNull: false;
|
|
968
|
+
hasDefault: false;
|
|
969
|
+
isPrimaryKey: false;
|
|
970
|
+
isAutoincrement: false;
|
|
971
|
+
hasRuntimeDefault: false;
|
|
972
|
+
enumValues: undefined;
|
|
973
|
+
identity: undefined;
|
|
974
|
+
generated: undefined;
|
|
975
|
+
}>;
|
|
976
|
+
sentAtUs: import("drizzle-orm/pg-core").PgBuildColumn<"pgxsinkit_all_mutations", import("drizzle-orm/pg-core").PgCustomColumnBuilder<{
|
|
977
|
+
dataType: 'custom';
|
|
978
|
+
data: string;
|
|
979
|
+
driverParam: string;
|
|
980
|
+
}>, {
|
|
981
|
+
name: string;
|
|
982
|
+
tableName: "pgxsinkit_all_mutations";
|
|
983
|
+
dataType: "custom";
|
|
984
|
+
data: string;
|
|
985
|
+
driverParam: string;
|
|
986
|
+
notNull: false;
|
|
987
|
+
hasDefault: false;
|
|
988
|
+
isPrimaryKey: false;
|
|
989
|
+
isAutoincrement: false;
|
|
990
|
+
hasRuntimeDefault: false;
|
|
991
|
+
enumValues: undefined;
|
|
992
|
+
identity: undefined;
|
|
993
|
+
generated: undefined;
|
|
994
|
+
}>;
|
|
995
|
+
ackedAtUs: import("drizzle-orm/pg-core").PgBuildColumn<"pgxsinkit_all_mutations", import("drizzle-orm/pg-core").PgCustomColumnBuilder<{
|
|
996
|
+
dataType: 'custom';
|
|
997
|
+
data: string;
|
|
998
|
+
driverParam: string;
|
|
999
|
+
}>, {
|
|
1000
|
+
name: string;
|
|
1001
|
+
tableName: "pgxsinkit_all_mutations";
|
|
1002
|
+
dataType: "custom";
|
|
1003
|
+
data: string;
|
|
1004
|
+
driverParam: string;
|
|
1005
|
+
notNull: false;
|
|
1006
|
+
hasDefault: false;
|
|
1007
|
+
isPrimaryKey: false;
|
|
1008
|
+
isAutoincrement: false;
|
|
1009
|
+
hasRuntimeDefault: false;
|
|
1010
|
+
enumValues: undefined;
|
|
1011
|
+
identity: undefined;
|
|
1012
|
+
generated: undefined;
|
|
1013
|
+
}>;
|
|
1014
|
+
updatedAtUs: import("drizzle-orm/pg-core").PgBuildColumn<"pgxsinkit_all_mutations", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgCustomColumnBuilder<{
|
|
1015
|
+
dataType: 'custom';
|
|
1016
|
+
data: string;
|
|
1017
|
+
driverParam: string;
|
|
1018
|
+
}>>, {
|
|
1019
|
+
name: string;
|
|
1020
|
+
tableName: "pgxsinkit_all_mutations";
|
|
1021
|
+
dataType: "custom";
|
|
1022
|
+
data: string;
|
|
1023
|
+
driverParam: string;
|
|
1024
|
+
notNull: true;
|
|
1025
|
+
hasDefault: false;
|
|
1026
|
+
isPrimaryKey: false;
|
|
1027
|
+
isAutoincrement: false;
|
|
1028
|
+
hasRuntimeDefault: false;
|
|
1029
|
+
enumValues: undefined;
|
|
1030
|
+
identity: undefined;
|
|
1031
|
+
generated: undefined;
|
|
1032
|
+
}>;
|
|
1033
|
+
}>;
|
|
1034
|
+
/**
|
|
1035
|
+
* The registry-wide `pgxsinkit_all_mutations` cross-journal view (slice 4) as a runtime Drizzle object. Its
|
|
1036
|
+
* columns are the fixed journal columns (typed) plus the `table_key` registry-key literal — no per-table PK
|
|
1037
|
+
* columns, no payload. Unlike the other view factories this is schema-INDEPENDENT: the view is always emitted
|
|
1038
|
+
* `TEMP` (it may reference `pg_temp` ephemeral journals), so it resolves bare via `pg_temp`/search_path
|
|
1039
|
+
* regardless of the registry's local schema — hence one memoized instance for every registry. The
|
|
1040
|
+
* `client.mutations.*` API authors its summary/detail queries over THIS object (tier ①).
|
|
1041
|
+
*/
|
|
1042
|
+
export type AllMutationsView = typeof allMutationsShape;
|
|
1043
|
+
export declare function getAllMutationsView(_registry: SyncTableRegistry): AllMutationsView;
|
|
704
1044
|
/** The `pgxsinkit_local_meta` key/value table (ADR-0006) under the registry's local schema. */
|
|
705
1045
|
export declare function getLocalMetaTable(registry: SyncTableRegistry): LocalMetaTable;
|
|
706
1046
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-tables.d.ts","sourceRoot":"","sources":["../src/local-tables.ts"],"names":[],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,OAAO,iBAAiB,CAAC;AAExD,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,iBAAiB,GAAG,gBAAgB,CAElF;AAED,+FAA+F;AAC/F,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,iBAAiB,GAAG,cAAc,CAY7E"}
|
package/dist/mutation.d.ts
CHANGED
|
@@ -71,6 +71,13 @@ export interface CreateMutationRuntimeOptions<TRegistry extends SyncTableRegistr
|
|
|
71
71
|
* `registry_version`, so a version-boundary crossing is known before sending (ADR-0006).
|
|
72
72
|
*/
|
|
73
73
|
registryVersion?: string;
|
|
74
|
+
/**
|
|
75
|
+
* Whether pgxsinkit owns the local schema (and therefore the `pgxsinkit_local_meta` table the durable
|
|
76
|
+
* recovery-required marker lives in). Defaults to `true`. A caller-owned `pgliteInstance` boot sets this
|
|
77
|
+
* `false`: the meta table may not exist, so the marker is never read/written and boot recovery falls back
|
|
78
|
+
* to the legacy always-recover pass (proposal §1 caller-owned-PGlite constraint).
|
|
79
|
+
*/
|
|
80
|
+
ownsMetaTable?: boolean;
|
|
74
81
|
/**
|
|
75
82
|
* Hard cap on send attempts before a still-failing mutation is quarantined
|
|
76
83
|
* (ADR-0005 congestion policy). Defaults to {@link DEFAULT_MAX_MUTATION_ATTEMPTS}.
|
|
@@ -115,6 +122,18 @@ export interface CreateMutationRuntimeOptions<TRegistry extends SyncTableRegistr
|
|
|
115
122
|
*/
|
|
116
123
|
onOrdinaryEnqueue?: (tables: readonly string[]) => void;
|
|
117
124
|
}
|
|
125
|
+
/**
|
|
126
|
+
* The result of {@link MutationRuntime.runBootRecovery}, shaped to feed the `warmBoot` BootReport fields
|
|
127
|
+
* directly (ADR-0034): whether the per-table recovery loop was skipped, whether recovery was required this
|
|
128
|
+
* boot, how many writable journals were visited, and how many rows were lifted `sending → pending` (`null`
|
|
129
|
+
* when the pass was legacy/uncounted, a real count on the marker-`true` path).
|
|
130
|
+
*/
|
|
131
|
+
export interface BootRecoveryOutcome {
|
|
132
|
+
skipped: boolean;
|
|
133
|
+
required: boolean;
|
|
134
|
+
tablesVisited: number;
|
|
135
|
+
rowsRecovered: number | null;
|
|
136
|
+
}
|
|
118
137
|
export interface MutationRuntime<TRegistry extends SyncTableRegistry> {
|
|
119
138
|
/** The registry fingerprint (ADR-0004) this runtime stamps onto enqueued mutations. */
|
|
120
139
|
registryVersion: string;
|
|
@@ -156,6 +175,23 @@ export interface MutationRuntime<TRegistry extends SyncTableRegistry> {
|
|
|
156
175
|
reconcile: (table?: SyncTableName<TRegistry>) => Promise<void>;
|
|
157
176
|
retryFailed: (table?: SyncTableName<TRegistry>) => Promise<void>;
|
|
158
177
|
recoverSending: (table?: SyncTableName<TRegistry>) => Promise<void>;
|
|
178
|
+
/**
|
|
179
|
+
* Boot-time journal recovery driven by the durable recovery-required marker (proposal §1 / slice 2). The
|
|
180
|
+
* internal boot entry point that decides — from the marker and the boot mode — whether the per-table
|
|
181
|
+
* `sending → pending` recovery loop runs at all, and clears/initializes the marker afterwards. It NEVER
|
|
182
|
+
* runs from a consumer call ({@link recoverSending} keeps today's exact per-table semantics and never
|
|
183
|
+
* touches the marker); {@link BootRecoveryOutcome} feeds the `warmBoot` BootReport fields verbatim.
|
|
184
|
+
*
|
|
185
|
+
* - `ownsMetaTable: false` (caller-owned PGlite) → legacy always-recover, marker untouched.
|
|
186
|
+
* - `restore: true` → legacy recovery + {@link quarantineRecovered} + self-verifying clear (marker ignored).
|
|
187
|
+
* - marker `false` → skip the loop entirely.
|
|
188
|
+
* - marker absent (legacy store) → one legacy recovery pass, then initialize the marker.
|
|
189
|
+
* - marker `true` → the N per-table updates PLUS the self-verifying clear, wrapped in one transaction.
|
|
190
|
+
*/
|
|
191
|
+
runBootRecovery: (opts: {
|
|
192
|
+
ownsMetaTable: boolean;
|
|
193
|
+
restore: boolean;
|
|
194
|
+
}) => Promise<BootRecoveryOutcome>;
|
|
159
195
|
/**
|
|
160
196
|
* Quarantine EVERY non-terminal journal row recovered from a backup (`pending`/`sending`/`failed` →
|
|
161
197
|
* `quarantined`) — the restore-boot rule (ADR-0035 decision 6). Nothing recovered from a store backup
|
package/dist/mutation.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mutation.d.ts","sourceRoot":"","sources":["../src/mutation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mutation.d.ts","sourceRoot":"","sources":["../src/mutation.ts"],"names":[],"mappings":"AA+EA,OAAO,KAAK,EAEV,WAAW,EACX,mBAAmB,EAEnB,oBAAoB,EAEpB,aAAa,EACb,eAAe,EACf,iBAAiB,EACjB,oBAAoB,EACpB,SAAS,EACV,MAAM,sBAAsB,CAAC;AAa9B,OAAO,EAIL,KAAK,cAAc,EACpB,MAAM,kBAAkB,CAAC;AAE1B,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE1D;;;;;GAKG;AACH,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,SAAS,CAAC;CACjB;AAED,MAAM,MAAM,iBAAiB,CAAC,SAAS,SAAS,iBAAiB,IAAI;KAClE,IAAI,IAAI,aAAa,CAAC,SAAS,CAAC,GAC7B;QACE,KAAK,EAAE,IAAI,CAAC;QACZ,IAAI,EAAE,QAAQ,CAAC;QACf,KAAK,EAAE,oBAAoB,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;KAC9C,GACD;QACE,KAAK,EAAE,IAAI,CAAC;QACZ,IAAI,EAAE,QAAQ,CAAC;QACf,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAClC,KAAK,EAAE,oBAAoB,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;QAC7C;;;;;WAKG;QACH,KAAK,CAAC,EAAE,OAAO,CAAC;KACjB,GACD;QACE,KAAK,EAAE,IAAI,CAAC;QACZ,IAAI,EA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E,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,CAYzG;AAED,wBAAgB,qBAAqB,CAAC,YAAY,EAAE,MAAM,UAGzD;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,GAAE,MAAM,MAAoB,UAG3F;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,GAAE,MAAM,MAAoB,UAE3G;AAED,wBAAgB,qBAAqB,CAAC,SAAS,SAAS,iBAAiB,EACvE,OAAO,EAAE,4BAA4B,CAAC,SAAS,CAAC,GAC/C,eAAe,CAAC,SAAS,CAAC,CA4iC5B"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type { MutationSummary, SyncTableName, SyncTableRegistry } from "@pgxsinkit/contracts";
|
|
2
|
+
import type { MutationDetail } from "./mutation";
|
|
3
|
+
import type { MutationStatus } from "./mutation-state";
|
|
4
|
+
export type { MutationDetail } from "./mutation";
|
|
5
|
+
export type MutationSummaryDetail = MutationDetail;
|
|
6
|
+
/** Optional filters for {@link MutationsApi.list} / {@link MutationsApi.subscribe}. */
|
|
7
|
+
export interface MutationListOptions<TRegistry extends SyncTableRegistry> {
|
|
8
|
+
/** Restrict to one registry table key (the `table_key` column). */
|
|
9
|
+
table?: SyncTableName<TRegistry>;
|
|
10
|
+
/**
|
|
11
|
+
* Restrict to one entity — matched on the serialized `entity_key_json` (`JSON.stringify(entityKey)`),
|
|
12
|
+
* byte-for-byte against the enqueue-time serialization. For a COMPOSITE key, pass the properties in the
|
|
13
|
+
* same order pgxsinkit serialized them (a key taken from a returned {@link MutationSummaryDetail} or the
|
|
14
|
+
* write API round-trips correctly; a hand-built object with a different property order silently matches
|
|
15
|
+
* nothing).
|
|
16
|
+
*/
|
|
17
|
+
entityKey?: Record<string, string>;
|
|
18
|
+
/** Restrict to a set of journal statuses. */
|
|
19
|
+
statuses?: readonly MutationStatus[];
|
|
20
|
+
/** Cap the returned rows (applied after the `enqueued_at_us` ordering). */
|
|
21
|
+
limit?: number;
|
|
22
|
+
}
|
|
23
|
+
/** A handle to a live summary subscription: the initial summary plus an idempotent unsubscribe. */
|
|
24
|
+
export interface MutationSummarySubscription {
|
|
25
|
+
initial: MutationSummary;
|
|
26
|
+
unsubscribe: () => void;
|
|
27
|
+
}
|
|
28
|
+
/** A handle to a live detail subscription: the initial ordered rows plus an idempotent unsubscribe. */
|
|
29
|
+
export interface MutationListSubscription {
|
|
30
|
+
initial: MutationSummaryDetail[];
|
|
31
|
+
unsubscribe: () => void;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* The registry-wide reactive mutation-status surface (`client.mutations`), identical on the in-process and
|
|
35
|
+
* worker-attached client. Consumers NEVER touch the generated journal relation names — everything routes
|
|
36
|
+
* through the `pgxsinkit_all_mutations` view.
|
|
37
|
+
*
|
|
38
|
+
* The `summary` is cheap enough to mount PERMANENTLY (one fingerprinted registration regardless of subscriber
|
|
39
|
+
* count — ADR-0040 dedup gives one shared rerun per journal write, not N). Full `list`/`subscribe` detail
|
|
40
|
+
* subscriptions should stay route- or feature-scoped.
|
|
41
|
+
*/
|
|
42
|
+
export interface MutationsApi<TRegistry extends SyncTableRegistry> {
|
|
43
|
+
/** One-shot per-status counts across every writable journal (absent statuses = 0). */
|
|
44
|
+
summary(): Promise<MutationSummary>;
|
|
45
|
+
/**
|
|
46
|
+
* Live per-status counts: `listener` fires on every change, the initial summary is on the returned handle
|
|
47
|
+
* (matching `subscribeLiveRows`' initial-via-return / changes-via-callback split). One registration
|
|
48
|
+
* regardless of subscriber count. Cheap to mount permanently.
|
|
49
|
+
*/
|
|
50
|
+
subscribeSummary(listener: (summary: MutationSummary) => void): Promise<MutationSummarySubscription>;
|
|
51
|
+
/** One-shot normalized detail rows, filtered by {@link MutationListOptions}, ordered newest-first by `enqueued_at_us`. */
|
|
52
|
+
list(options?: MutationListOptions<TRegistry>): Promise<MutationSummaryDetail[]>;
|
|
53
|
+
/**
|
|
54
|
+
* Live normalized detail rows (same filters/ordering as {@link list}). Route/feature-scoped: a detail
|
|
55
|
+
* subscription reruns the union SELECT on each relevant write — cheap for a scoped view, but prefer the
|
|
56
|
+
* summary for anything mounted app-wide.
|
|
57
|
+
*/
|
|
58
|
+
subscribe(options: MutationListOptions<TRegistry>, listener: (rows: MutationSummaryDetail[]) => void): Promise<MutationListSubscription>;
|
|
59
|
+
}
|
|
60
|
+
/** The seams the factory needs — shared verbatim by both client modes (zero worker-protocol change). */
|
|
61
|
+
export interface MutationsApiDeps<TRegistry extends SyncTableRegistry> {
|
|
62
|
+
registry: TRegistry;
|
|
63
|
+
subscribeLiveRows: <TRow extends Record<string, unknown>>(input: {
|
|
64
|
+
sql: string;
|
|
65
|
+
params: readonly unknown[];
|
|
66
|
+
}, onRows: (rows: TRow[]) => void) => Promise<{
|
|
67
|
+
initialRows: TRow[];
|
|
68
|
+
unsubscribe: () => void;
|
|
69
|
+
}>;
|
|
70
|
+
/** One-shot query seam (in-process `pglite.query`; worker-attached the `rawQuery` RPC). Rows are UNMAPPED. */
|
|
71
|
+
query: (sql: string, params?: unknown[]) => Promise<{
|
|
72
|
+
rows: Record<string, unknown>[];
|
|
73
|
+
}>;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Build the `client.mutations` API over the shared seams. Implemented ONCE — both client modes pass their own
|
|
77
|
+
* `subscribeLiveRows` + one-shot `query`, so semantics are identical and the worker bridge is untouched. A
|
|
78
|
+
* registry with NO writable table emits no view, so the API short-circuits to empty shapes WITHOUT touching
|
|
79
|
+
* the (absent) view — derived from the registry, never a runtime probe.
|
|
80
|
+
*/
|
|
81
|
+
export declare function createMutationsApi<TRegistry extends SyncTableRegistry>(deps: MutationsApiDeps<TRegistry>): MutationsApi<TRegistry>;
|
|
82
|
+
//# sourceMappingURL=mutations-api.d.ts.map
|
|
@@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