@pgxsinkit/contracts 0.3.0 → 0.5.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/LICENSE +21 -0
- package/dist/apply-strategy.d.ts +13 -1
- package/dist/apply-strategy.d.ts.map +1 -1
- package/dist/config.d.ts +131 -4
- package/dist/config.d.ts.map +1 -1
- package/dist/index.js +113 -5
- package/dist/index.js.map +7 -7
- package/dist/projection.d.ts +1 -1
- package/dist/projection.d.ts.map +1 -1
- package/dist/registry.d.ts +7 -5
- package/dist/registry.d.ts.map +1 -1
- package/dist/sql-role-guard.d.ts +1 -1
- package/package.json +3 -2
- package/skills/registry-authoring/SKILL.md +77 -77
- package/skills/registry-authoring/references/storage-engine-and-build.md +29 -0
- package/src/apply-strategy.ts +23 -4
- package/src/config.ts +187 -5
- package/src/projection.ts +5 -1
- package/src/registry.ts +132 -14
- package/src/sql-role-guard.ts +1 -1
package/dist/projection.d.ts
CHANGED
|
@@ -33,7 +33,7 @@ import type { SyncTableEntry, SyncTableRegistry } from "./registry";
|
|
|
33
33
|
export declare function asReadonly<TTable extends AnyPgTable, TLocalTable extends AnyPgTable>(entry: SyncTableEntry<TTable, TLocalTable>): SyncTableEntry<TTable, TLocalTable>;
|
|
34
34
|
/**
|
|
35
35
|
* Project an entry onto a different **retention** (ADR-0021) — the per-table local-persistence axis:
|
|
36
|
-
* `persistent` (the durable
|
|
36
|
+
* `persistent` (the durable pgwasm/OPFS backend) | `ephemeral` (the table's whole local cluster — read
|
|
37
37
|
* cache, overlay, journal, sequence, views, reconcile function — emitted as `TEMP`/`pg_temp`, leaving no
|
|
38
38
|
* durable trace). Returns a copy of `entry` with `retention` overridden and **everything else preserved
|
|
39
39
|
* verbatim** (table, columns, mode, write contract, shape/row filter, the other lifecycle axes).
|
package/dist/projection.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projection.d.ts","sourceRoot":"","sources":["../src/projection.ts"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BAAiB,EAC7B,OAAO,CAAC,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GAC3B,IAAI,CAsBN"}
|
package/dist/registry.d.ts
CHANGED
|
@@ -45,7 +45,7 @@ type SyncTableInputGovernanceMarker<TGovernance> = {
|
|
|
45
45
|
export interface SyncTableEntry<TTable extends AnyPgTable = AnyPgTable, TLocalTable extends AnyPgTable = TTable> {
|
|
46
46
|
table: TTable;
|
|
47
47
|
/**
|
|
48
|
-
* Projected client-side table for
|
|
48
|
+
* Projected client-side table for pgwasm use. Columns listed in
|
|
49
49
|
* `clientProjection.omitColumns` (e.g. `created_by_id`) are absent from
|
|
50
50
|
* both the runtime table definition and the TypeScript shape of this table.
|
|
51
51
|
*/
|
|
@@ -316,9 +316,11 @@ export interface SyncRegistryDefinition<TRegistry extends SyncTableRegistry> {
|
|
|
316
316
|
/**
|
|
317
317
|
* The storage contract for every store this registry mints (ADR-0049 decision 1, ADR-0047). Part of the
|
|
318
318
|
* DATA contract, not a per-open knob: `durability` binds every toolkit-minted open (relaxed default),
|
|
319
|
-
*
|
|
320
|
-
* unaffected)
|
|
321
|
-
* the
|
|
319
|
+
* `backend` scopes the BROWSER store only (`opfs` default; Node/`file` and `memory` clones
|
|
320
|
+
* unaffected), and `engine` names the store-factory module that mints the store at all (absent default —
|
|
321
|
+
* the toolkit's own). Validated at {@link defineSyncRegistry} (fail-closed at module-eval); carried
|
|
322
|
+
* through on the returned registry and read back with {@link getSyncRegistryStorage}. See
|
|
323
|
+
* {@link SyncStorageDeclaration}.
|
|
322
324
|
*/
|
|
323
325
|
storage?: SyncStorageDeclaration;
|
|
324
326
|
/**
|
|
@@ -812,7 +814,7 @@ export declare function defineSyncTable<const TName extends string, const TColum
|
|
|
812
814
|
* stale opt-out cannot silently pre-authorize a leak the day the owner grows one.
|
|
813
815
|
*/
|
|
814
816
|
export declare function defineReadProjection<const TOwnerTable extends AnyPgTable, const TOwnerLocal extends AnyPgTable, const TAs extends string, const TColumns extends readonly TableColumnKey<TOwnerTable>[] = readonly TableColumnKey<TOwnerTable>[]>(owner: SyncTableEntry<TOwnerTable, TOwnerLocal>, opts: {
|
|
815
|
-
/** The projection's distinct local identity — its
|
|
817
|
+
/** The projection's distinct local identity — its pgwasm table name AND its `shapeKey`. */
|
|
816
818
|
as: TAs;
|
|
817
819
|
/** Column keys (of the owner) to sync locally + fetch on the shape. The PK is always kept. Omit → all. */
|
|
818
820
|
columns?: TColumns;
|
package/dist/registry.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACpG,OAAO,EAQL,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,yBAAyB,EAC9B,KAAK,QAAQ,EACb,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,MAAM,EACX,KAAK,mBAAmB,EACxB,KAAK,UAAU,EAChB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EAAE,KAAK,aAAa,EAAyB,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClG,OAAO,EAeL,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,wBAAwB,EAC7B,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,oBAAoB,EACzB,KAAK,SAAS,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S,SAAS,iBAAiB,EACxE,QAAQ,EAAE,SAAS,GAClB,sBAAsB,GAAG,SAAS,CAGpC;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAAC,SAAS,SAAS,iBAAiB,EAC9E,QAAQ,EAAE,SAAS,EACnB,UAAU,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,aAyB1C;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,SAAS,SAAS,iBAAiB,EAC3E,QAAQ,EAAE,SAAS,GAClB,SAAS,MAAM,EAAE,GAAG,SAAS,CAG/B;AAED;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,CAAC,SAAS,SAAS,iBAAiB,EAC3E,QAAQ,EAAE,SAAS,EACnB,OAAO,EAAE,mBAAmB,GAAG,SAAS,aA+BzC;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,SAAS,iBAAiB,EACxE,QAAQ,EAAE,SAAS,GAClB,mBAAmB,GAAG,SAAS,CAGjC"}
|
package/dist/sql-role-guard.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* The single role-existence guard used by every pgxsinkit-emitted GRANT/REVOKE.
|
|
3
3
|
*
|
|
4
4
|
* pgxsinkit artifacts are portable: the same migration runs on a Supabase-shaped cluster (where
|
|
5
|
-
* `anon`/`authenticated`/`service_role` exist), on a plain Postgres, and on a
|
|
5
|
+
* `anon`/`authenticated`/`service_role` exist), on a plain Postgres, and on a pgwasm test lane
|
|
6
6
|
* (where none of them do). A bare `REVOKE … FROM anon` is a hard error where the role is absent, so
|
|
7
7
|
* every role-scoped grant/revoke is wrapped in a `DO $$ … IF EXISTS (SELECT 1 FROM pg_roles …)`
|
|
8
8
|
* block and simply does nothing there.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pgxsinkit/contracts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"tanstack-intent"
|
|
6
6
|
],
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
"dist",
|
|
10
10
|
"src",
|
|
11
11
|
"README.md",
|
|
12
|
+
"LICENSE",
|
|
12
13
|
"skills"
|
|
13
14
|
],
|
|
14
15
|
"type": "module",
|
|
@@ -28,7 +29,7 @@
|
|
|
28
29
|
},
|
|
29
30
|
"peerDependencies": {
|
|
30
31
|
"drizzle-orm": "1.0.0-rc.4",
|
|
31
|
-
"zod": "^4.
|
|
32
|
+
"zod": "^4.6.5"
|
|
32
33
|
},
|
|
33
34
|
"repository": {
|
|
34
35
|
"type": "git",
|
|
@@ -15,7 +15,7 @@ description: >-
|
|
|
15
15
|
metadata:
|
|
16
16
|
type: core
|
|
17
17
|
library: "@pgxsinkit/contracts"
|
|
18
|
-
library_version: "0.
|
|
18
|
+
library_version: "0.5.0"
|
|
19
19
|
source: https://pgxsinkit.github.io/start/getting-started/
|
|
20
20
|
---
|
|
21
21
|
|
|
@@ -56,14 +56,13 @@ widgets: defineSyncTable({
|
|
|
56
56
|
}),
|
|
57
57
|
```
|
|
58
58
|
|
|
59
|
-
**Column types don't constrain sync.** The read-path backfill picks a bulk-insert tier (COPY / JSON /
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
stores
|
|
65
|
-
|
|
66
|
-
`managedFields` target (both strategies stamp one scalar).
|
|
59
|
+
**Column types don't constrain sync.** The read-path backfill picks a bulk-insert tier (COPY / JSON / per-row
|
|
60
|
+
`INSERT`) statically from a table's Drizzle column types; enum columns and `GENERATED ALWAYS AS IDENTITY` primary
|
|
61
|
+
keys are fully supported (labels round-trip through COPY/JSON, a synced identity PK keeps the server's value via
|
|
62
|
+
`OVERRIDING SYSTEM VALUE`), so never avoid them for sync's sake. **Array columns are supported at ONE dimension**
|
|
63
|
+
(`uuid("source_ids").array()`) on both paths: a write sends a JSON array, `[]` stores an empty array and JSON `null`
|
|
64
|
+
stores NULL, element order preserved. Everything else about arrays fails at GENERATE time, named — `.array("[][]")`
|
|
65
|
+
(multi-dimensional), an array PK column, and an array `managedFields` target (both strategies stamp one scalar).
|
|
67
66
|
|
|
68
67
|
## The `primaryKey` spec emits the physical PRIMARY KEY — it is the single source of truth
|
|
69
68
|
|
|
@@ -83,16 +82,15 @@ produce), so pgxsinkit DDL matches plain-Postgres inline-PK DDL and drizzle-kit
|
|
|
83
82
|
|
|
84
83
|
`applyMode` no longer chooses how steady-state changes apply (ADR-0058). The engine's wire vocabulary is
|
|
85
84
|
`upsert | delete` — an `upsert` states a row's value without claiming it is new — so **every** streamed change
|
|
86
|
-
applies as `INSERT … ON CONFLICT (pk) DO UPDATE`, whatever this says. What survives is the **initial load**: a
|
|
87
|
-
|
|
88
|
-
|
|
85
|
+
applies as `INSERT … ON CONFLICT (pk) DO UPDATE`, whatever this says. What survives is the **initial load**: a fresh
|
|
86
|
+
subscription or a post-must-refetch re-snapshot lands on a table assumed empty, which is what lets it use COPY or a
|
|
87
|
+
plain multi-row INSERT, neither of which can express `ON CONFLICT`.
|
|
89
88
|
|
|
90
89
|
**`"insert"` (default)** keeps that fast path, so a row already sitting there surfaces as a real precondition
|
|
91
|
-
failure. **Use `"upsert"` only** when the emptiness assumption does not hold — this table legitimately
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
the default repo-wide.
|
|
90
|
+
failure. **Use `"upsert"` only** when the emptiness assumption does not hold — this table legitimately receives
|
|
91
|
+
locally-**derived** provisional rows (a local trigger on another synced table writes a row here that the server
|
|
92
|
+
independently creates too) that a backfill could land on top of. It then takes the conflict-tolerant applier, at the
|
|
93
|
+
cost of the faster path. Declare the exception where it lives; never weaken the default repo-wide.
|
|
96
94
|
|
|
97
95
|
## Managed fields are server-assigned — never send them
|
|
98
96
|
|
|
@@ -129,6 +127,14 @@ that is not a writable (projected) column splits into exactly two cases:
|
|
|
129
127
|
The rule that follows: **write a server-only (omitted) column outside the sync rail** — a server-side
|
|
130
128
|
`UPDATE`, a trigger, or a managed field (`governance.managedFields`); the route rejects it in a payload.
|
|
131
129
|
|
|
130
|
+
## Local indexes are opt-in — your server's indexes are NOT mirrored
|
|
131
|
+
|
|
132
|
+
The local store renders a synced table's primary key and nothing else: server indexes serve server loads and many
|
|
133
|
+
cover projected-away columns. A client read that needs one declares it — `clientProjection: { localIndexes: [{ name:
|
|
134
|
+
"cards_due_at_idx", columns: ["dueAt"] }] }`, an ascending btree over projected columns (`unique?` optional), refused
|
|
135
|
+
at registry-build time if a column is unknown or omitted or a name repeats. Index only what the **client** scans (a
|
|
136
|
+
due window over 100k local-store rows: ~13 ms sequential vs ~0.1 ms indexed); each index costs write time per batch.
|
|
137
|
+
|
|
132
138
|
## Read-path filtering: `customPredicate` compiles to a predicate AST, not SQL
|
|
133
139
|
|
|
134
140
|
A table's `shape.rowFilter.customPredicate` is compiled by the **control plane** at shape creation — once per
|
|
@@ -145,11 +151,10 @@ function widgetsReadFilter(claims: JwtClaims): Predicate | null {
|
|
|
145
151
|
```
|
|
146
152
|
|
|
147
153
|
The builders are `p.eq`/`p.ne`/`p.lt`/`p.lte`/`p.gt`/`p.gte`, `p.like`/`p.notLike`, `p.isNull`/`p.isNotNull`,
|
|
148
|
-
`p.and`/`p.or`/`p.not`, and `p.in`/`p.notIn` over a `p.subquery` (below) — namespaced so they never collide
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
stores it and pass the string.
|
|
154
|
+
`p.and`/`p.or`/`p.not`, and `p.in`/`p.notIn` over a `p.subquery` (below) — namespaced so they never collide with
|
|
155
|
+
`drizzle-orm`'s `eq`/`and`/`or`. Every comparison is checked against the column's own TypeScript type, so a mistyped
|
|
156
|
+
enum label, a `null` against a NOT NULL column, or a `jsonb`/`Date` column with no scalar wire form is a **compile
|
|
157
|
+
error**. **No `::text` casts** — values are typed JSON scalars; render a `Date` as the column stores it, as a string.
|
|
153
158
|
|
|
154
159
|
**Inline (all-in-one `defineSyncTable`) — `rowFilter` as a function of the columns.** The example above
|
|
155
160
|
assumes the table is built _elsewhere_. Declaring a table and its filter in **one** call, the table object
|
|
@@ -168,20 +173,19 @@ defineSyncTable({
|
|
|
168
173
|
});
|
|
169
174
|
```
|
|
170
175
|
|
|
171
|
-
The column callback is the only authoring form. **Say deny explicitly:** a `customPredicate` returning `null`
|
|
172
|
-
|
|
173
|
-
`DENY_ALL_PREDICATE` is the deny, recognised by reference: the control plane declines to create the shape at
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
176
|
+
The column callback is the only authoring form. **Say deny explicitly:** a `customPredicate` returning `null` means
|
|
177
|
+
_no filter — every row visible_, so an owner filter returning `null` for "no claim" exposes every row.
|
|
178
|
+
`DENY_ALL_PREDICATE` is the deny, recognised by reference: the control plane declines to create the shape at all, so
|
|
179
|
+
a denied subject holds no stream. It must also be **pure** (called per shape creation, and probed with empty claims
|
|
180
|
+
to detect claims-dependence), and a `rowFilter` restricting nothing — no `customPredicate`, no `columns` allow-list
|
|
181
|
+
— **throws at definition time** rather than compiling to a shape with no subject test.
|
|
177
182
|
|
|
178
183
|
## Cross-table filters: `p.subquery` over another table's column
|
|
179
184
|
|
|
180
|
-
A **membership fan-out** — "sync a row only if the subject belongs to its container" — is a `customPredicate`
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
membership RLS predicate):
|
|
185
|
+
A **membership fan-out** — "sync a row only if the subject belongs to its container" — is a `customPredicate` whose
|
|
186
|
+
test is a **subquery over another table**. `p.subquery(projectedColumn, where?)` names the inner set by the column it
|
|
187
|
+
projects, so there is no table name to get wrong and no way to project a column that table does not have. Factor it
|
|
188
|
+
into a helper the read filter and any narrower variant share (the read-path twin of the membership RLS predicate):
|
|
185
189
|
|
|
186
190
|
```ts
|
|
187
191
|
// Uncorrelated by construction: the inner `where` reads the membership table's own columns only.
|
|
@@ -195,13 +199,12 @@ function widgetsReadFilter(claims: JwtClaims): Predicate {
|
|
|
195
199
|
}
|
|
196
200
|
```
|
|
197
201
|
|
|
198
|
-
What the AST form buys: columns stay rename-safe and existence-checked, the projected column's type rides on
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
from `(columns) => …`, the foreign table is imported built.
|
|
202
|
+
What the AST form buys: columns stay rename-safe and existence-checked, the projected column's type rides on the
|
|
203
|
+
`SubqueryRef` so `p.in` refuses an outer column it cannot be compared with, and the engine maintains the inner set
|
|
204
|
+
**incrementally and shares it across every shape referencing the same subquery** — an entitlement-shaped membership
|
|
205
|
+
costs one index, not one per shape. Two constraints: `IN` is **single-column** (no composite `(a, b) IN (…)`), and the
|
|
206
|
+
subquery stays **uncorrelated** — its `where` never references the outer row. Combine with the function form when the
|
|
207
|
+
table is defined all-in-one: the row's own column comes from `(columns) => …`, the foreign table is imported built.
|
|
205
208
|
|
|
206
209
|
## RLS: derive read and write from the same Drizzle columns
|
|
207
210
|
|
|
@@ -221,14 +224,13 @@ row readable-but-unwritable (or vice versa):
|
|
|
221
224
|
SECURITY DEFINER membership helper, a `current_setting('request.jwt.claims')` admin check), and inline that
|
|
222
225
|
predicate rather than referencing a not-yet-created function. For "compare OLD vs NEW" rules RLS cannot
|
|
223
226
|
help (`WITH CHECK` sees only NEW, `USING` only OLD) — use a `BEFORE UPDATE` trigger.
|
|
224
|
-
- **Do not hand-write the read half — every policy family ships its read-path mirror.** The sync engine
|
|
225
|
-
|
|
226
|
-
`buildOwnershipShapePredicate`, `buildOwnerOrAdminShapePredicate` (admin → `null`, mirroring the policy's
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
`
|
|
230
|
-
|
|
231
|
-
probes claims-dependent.
|
|
227
|
+
- **Do not hand-write the read half — every policy family ships its read-path mirror.** The sync engine cannot read
|
|
228
|
+
RLS, so the shape predicate re-derives the same visible set in JS from the same declaration:
|
|
229
|
+
`buildOwnershipShapePredicate`, `buildOwnerOrAdminShapePredicate` (admin → `null`, mirroring the policy's bypass
|
|
230
|
+
branch), `buildMembershipShapePredicate` (pass the **same** options object you gave the policy builder), and
|
|
231
|
+
`buildGrantScopeAccessShapePredicate` (bypass grant → `null` too; bare `resolveGrantScopeIds` +
|
|
232
|
+
`buildGrantScopeShapePredicate` cannot see it). Each takes the column plus the claims; return it straight from
|
|
233
|
+
`customPredicate` — they deny with `DENY_ALL_PREDICATE`, so the filter probes claims-dependent.
|
|
232
234
|
- Two mirror properties: they cover **SELECT only** (write-gate branches stay with the
|
|
233
235
|
INSERT/UPDATE/DELETE policies), and the two surfaces express containment in **different forms on
|
|
234
236
|
purpose** — RLS emits `= ANY(ARRAY(select …))` for the InitPlan/index-scan discipline, the read half a
|
|
@@ -241,12 +243,12 @@ never created or dropped.
|
|
|
241
243
|
|
|
242
244
|
## Composition obligations: two correct policies can still break an invariant
|
|
243
245
|
|
|
244
|
-
The registry keeps ONE table's read filter and write policy from drifting. A domain invariant usually spans
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
246
|
+
The registry keeps ONE table's read filter and write policy from drifting. A domain invariant usually spans several
|
|
247
|
+
tables and rails, and no registry feature can see that composition. Worked example: an invite table's RLS grants an
|
|
248
|
+
offering-scoped teacher INSERT; an acceptance worker then mints a membership row. Each policy is correct alone;
|
|
249
|
+
together they violate "this offering only ever has one member". The worker's semantics are invisible to per-table
|
|
250
|
+
declarations, so the obligation is permanently the consumer's. When you add a worker, route, or trigger that writes
|
|
251
|
+
rows as a CONSEQUENCE of other rows:
|
|
250
252
|
|
|
251
253
|
- List the invariants the OUTPUT table participates in, not just the input's — the output is where the
|
|
252
254
|
violation lands — and for each ask whether the composed path enforces it or merely assumes the input row's
|
|
@@ -261,10 +263,10 @@ route, or trigger that writes rows as a CONSEQUENCE of other rows:
|
|
|
261
263
|
## Provision the apply function from the registry
|
|
262
264
|
|
|
263
265
|
The write path applies through one in-database PL/pgSQL function, `pgxsinkit_apply_mutations`. Generate its
|
|
264
|
-
drizzle-kit migration with the `pgxsinkit-generate` CLI (a `bin` of `@pgxsinkit/server`) and apply it through
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
266
|
+
drizzle-kit migration with the `pgxsinkit-generate` CLI (a `bin` of `@pgxsinkit/server`) and apply it through your
|
|
267
|
+
normal migration flow; it is **deny-by-default** (see `deploying` for `--grant-execute-to`). It and the audit/version
|
|
268
|
+
column DEFAULTs both **call** `public.pgxsinkit_clock_us()`, so the `--utilities` migration installing that clock
|
|
269
|
+
must be **first in the chain** (hence the early-sorting name):
|
|
268
270
|
|
|
269
271
|
```bash
|
|
270
272
|
bun run pgxsinkit-generate --registry ./sync-registry.ts --export registry \
|
|
@@ -275,13 +277,13 @@ bun run pgxsinkit-generate --utilities \
|
|
|
275
277
|
|
|
276
278
|
## Multi-client: one authoritative registry, readonly projections (ADR-0025)
|
|
277
279
|
|
|
278
|
-
When the same table is `readwrite` for one client and `readonly` for another, `mode` is **per-client**, not
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
280
|
+
When the same table is `readwrite` for one client and `readonly` for another, `mode` is **per-client**, not a
|
|
281
|
+
property of the table: define it **once** in an authoritative registry at its writable capability and project it per
|
|
282
|
+
client. `mode` is baked at `defineSyncTable` time and drives the overlay/journal machinery + the `_read_model` view,
|
|
283
|
+
so a hand-spread `{ ...entry, mode: "readonly" }` is **broken** (it keeps a view over overlay state the readonly
|
|
284
|
+
client never creates). `asReadonly` re-derives a true readonly entry — dropping the overlay/journal projection, the
|
|
285
|
+
view, and `conflictPolicy`/`governance`/`writeMode`, keeping columns, primary key, synced table, shape/row filter
|
|
286
|
+
and `rowClass`.
|
|
285
287
|
|
|
286
288
|
```ts
|
|
287
289
|
const authoritativeRegistry = defineSyncRegistry({ posting_restriction: postingRestrictionEntry }); // readwrite
|
|
@@ -388,18 +390,17 @@ class is a `risky` diff. It complements `RowFilterSpec.revision`: only `revision
|
|
|
388
390
|
logic change move the fingerprint (rebuilding the cache, resetting the subscription), while the assertion
|
|
389
391
|
renders that logic — for the fixtures you hand it, and no others.
|
|
390
392
|
|
|
391
|
-
## Storage declaration: `storage.backend`
|
|
393
|
+
## Storage declaration: `storage.backend`, `durability`, `engine`, `build` (browser stores)
|
|
392
394
|
|
|
393
|
-
The registry carries the browser store's storage contract — `SyncRegistryDefinition.storage`,
|
|
394
|
-
|
|
395
|
-
minting surface, worker entry, or attach site, because
|
|
395
|
+
The registry carries the browser store's storage contract — `SyncRegistryDefinition.storage`, `{ backend?: "opfs" |
|
|
396
|
+
"idbfs"; durability?: "relaxed" | "strict"; engine?: { module }; build?: "c" | "pgrust" }` (`engine`, `build`:
|
|
397
|
+
[references/storage-engine-and-build.md](references/storage-engine-and-build.md)). It lives on the registry, not on a minting surface, worker entry, or attach site, because every property follows the DATA: one declaration
|
|
396
398
|
binds every open of every store minted from that registry, so no tab can disagree with another.
|
|
397
399
|
|
|
398
|
-
- **`backend`** (default `"opfs"`) — the normal boot everywhere: the toolkit probes OPFS sync-access at boot
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
only decision you declare is whether to force idb.
|
|
400
|
+
- **`backend`** (default `"opfs"`) — the normal boot everywhere: the toolkit probes OPFS sync-access at boot and
|
|
401
|
+
runs the `opfs-repacked` engine wherever handles are granted, falling back automatically to in-SharedWorker idbfs
|
|
402
|
+
(declared durability kept) only where the platform grants them nowhere. `backend: "idbfs"` is the one opt-out (no
|
|
403
|
+
probe, no election). Where the engine runs is never a knob; the only decision you declare is whether to force idb.
|
|
403
404
|
- **`durability`** (default `"relaxed"`) — relaxed returns the local write before the physical flush and
|
|
404
405
|
schedules it asynchronously; `"strict"` awaits the flush per commit. Relaxed is right for a sync toolkit
|
|
405
406
|
(the server is the source of truth, and the loss window is one recent action); declare `"strict"` only for
|
|
@@ -477,9 +478,8 @@ export const registry = defineSyncRegistry({
|
|
|
477
478
|
- Trying to write an `omitColumns` (server-only) column from a client payload — the write route
|
|
478
479
|
**400-rejects** it (an unknown typo is instead silently dropped, surfaced by a per-process `console.warn`);
|
|
479
480
|
write them outside the sync rail (a server `UPDATE`, a trigger, or a managed field).
|
|
480
|
-
- In a `customPredicate`: returning `null` for "no claim" (that is _every row_ — return `DENY_ALL_PREDICATE`),
|
|
481
|
-
|
|
482
|
-
exists.
|
|
481
|
+
- In a `customPredicate`: returning `null` for "no claim" (that is _every row_ — return `DENY_ALL_PREDICATE`), a
|
|
482
|
+
`rowFilter` that restricts nothing (throws), a correlated `p.subquery`, or SQL text where a `p.*` builder exists.
|
|
483
483
|
- A multi-dimensional array column, an array PK, or a managed field on an array column — each fails at
|
|
484
484
|
generate time; single-dimension arrays are fully supported on both paths.
|
|
485
485
|
- Letting the read filter and RLS policy diverge instead of building both from the same Drizzle columns.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# `storage.engine` and `storage.build`
|
|
2
|
+
|
|
3
|
+
Both are part of the store's **identity**, like `backend`: one declaration binds every open of every store
|
|
4
|
+
minted from the registry, and changing either means minting a fresh store under a fresh path — never
|
|
5
|
+
reopening an existing one.
|
|
6
|
+
|
|
7
|
+
## `storage.engine` — a different store engine
|
|
8
|
+
|
|
9
|
+
`storage: { engine: { module: "/store-engine/factory.js" } }`. `module` is an absolute or origin-relative module
|
|
10
|
+
URL. pgxsinkit `import()`s it in whichever scope is minting and takes its **default export** — or, failing
|
|
11
|
+
that, a named `createStore` — as the store factory: `(storePath: string, backendOverride?: "memory") =>
|
|
12
|
+
Promise<PgwasmClient>`, the same signature as `defineSyncWorker`'s `createStore` option. That module then
|
|
13
|
+
answers for the store instead of the built-in `createPgwasmClient`. Absent (the default) is the built-in
|
|
14
|
+
store. The module owns its own assets (derive them from `import.meta.url`), its storage layout under the store
|
|
15
|
+
path, and its environment requirements; serve it same-origin. A module that will not load, or exports no
|
|
16
|
+
factory, fails the mint loudly naming the module — it never falls back to the built-in store.
|
|
17
|
+
Full prose: <https://pgxsinkit.github.io/concepts/worker-mode/#declaring-a-different-store-engine>.
|
|
18
|
+
|
|
19
|
+
## `storage.build` — the Postgres build
|
|
20
|
+
|
|
21
|
+
`storage: { build: "c" }`. `build` names the Postgres build that owns every store minted from the registry:
|
|
22
|
+
`"c"` (the default, `cBuild` from `@pgxsinkit/pgwasm-c`) or `"pgrust"`. A data directory belongs to the build
|
|
23
|
+
that created it, so a different build is a different store. The declaration only names the build; the app
|
|
24
|
+
supplies the build itself as code (the `build` option of `createSyncClient`, `defineSyncWorker` and
|
|
25
|
+
`createPgwasmClient`), and a supplied or adopted build that is not the declared one fails with
|
|
26
|
+
`StorageBuildMismatchError` before any store is touched. A bare table map declares it with
|
|
27
|
+
`attachSyncRegistryStorage`. It may also travel on the wire with a dynamic declaration; an explicit
|
|
28
|
+
disagreement between the two is a `StorageDeclarationRefusedError`. Leave it at the default unless the app
|
|
29
|
+
runs another build. Full prose: <https://pgxsinkit.github.io/concepts/postgres-builds/>.
|
package/src/apply-strategy.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Static, type-driven read-path apply ladder (ADR-0009 decision 3).
|
|
3
3
|
*
|
|
4
|
-
* We own the registry's column types ahead of time and only ever target the latest
|
|
4
|
+
* We own the registry's column types ahead of time and only ever target the latest pgwasm, so the
|
|
5
5
|
* bulk-insert strategy for a synced table is chosen **once, statically** from its column types —
|
|
6
6
|
* never by probing `information_schema` at runtime. This module is the pure, dependency-free core
|
|
7
7
|
* (no registry, no Drizzle import) so it stays in the fast unit lane; {@link deriveSyncColumnTypes}
|
|
@@ -36,7 +36,7 @@ export interface SyncColumnType {
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
|
-
* Postgres scalar types whose JS→CSV-text rendering is unambiguous, so
|
|
39
|
+
* Postgres scalar types whose JS→CSV-text rendering is unambiguous, so pgwasm `COPY ... FROM`
|
|
40
40
|
* round-trips them losslessly. Deliberately **conservative** (ADR-0009 decision 3): never add a
|
|
41
41
|
* type here unless `COPY` truly handles it. Notably EXCLUDES timestamps/dates (format nuances),
|
|
42
42
|
* `numeric` (precision/format), `bytea`, `interval`, `json`/`jsonb`, and arrays — those route to the
|
|
@@ -85,7 +85,7 @@ function isCopySafe(column: SyncColumnType): boolean {
|
|
|
85
85
|
if (column.isArray) {
|
|
86
86
|
return false;
|
|
87
87
|
}
|
|
88
|
-
// Enum labels are plain text on the COPY wire;
|
|
88
|
+
// Enum labels are plain text on the COPY wire; pgwasm's COPY input casts them into the enum type
|
|
89
89
|
// losslessly, so an enum column is COPY-safe even though its `sqlType` (the enum name) is not a base type.
|
|
90
90
|
if (column.isEnum) {
|
|
91
91
|
return true;
|
|
@@ -95,7 +95,7 @@ function isCopySafe(column: SyncColumnType): boolean {
|
|
|
95
95
|
|
|
96
96
|
/**
|
|
97
97
|
* `json_to_recordset` extends the COPY-safe set with arrays, `json`, and `jsonb` — viable now that
|
|
98
|
-
* the latest
|
|
98
|
+
* the latest pgwasm round-trips bigint and bigint[] correctly (ADR-0009 decision 3).
|
|
99
99
|
*/
|
|
100
100
|
function isJsonSafe(column: SyncColumnType): boolean {
|
|
101
101
|
if (isCopySafe(column)) {
|
|
@@ -108,6 +108,25 @@ function isJsonSafe(column: SyncColumnType): boolean {
|
|
|
108
108
|
return base === "json" || base === "jsonb";
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
+
/**
|
|
112
|
+
* The Postgres `udt_name` of a `json`/`jsonb` column — `json`/`jsonb` for a scalar one, `_json`/`_jsonb`
|
|
113
|
+
* for an array one — and `undefined` for every other column. The single classifier for "is this a JSON
|
|
114
|
+
* column, and is it an array of them?", shared by the read path's wire decode (which parses the cell of a
|
|
115
|
+
* SCALAR json column — see `envelopeToChange`) and the COPY serializer's `udtName` map, so the two cannot
|
|
116
|
+
* disagree about which columns carry JSON.
|
|
117
|
+
*
|
|
118
|
+
* The array forms are reported but deliberately NOT decoded: an array column arrives (and stays) in
|
|
119
|
+
* Postgres's own `array_out` text, which every apply tier hands straight back to `array_in` — the element
|
|
120
|
+
* JSON inside it is Postgres's business, not ours.
|
|
121
|
+
*/
|
|
122
|
+
export function jsonUdtName(column: SyncColumnType): "json" | "jsonb" | "_json" | "_jsonb" | undefined {
|
|
123
|
+
const base = normalizeBaseType(column.sqlType);
|
|
124
|
+
if (base !== "json" && base !== "jsonb") {
|
|
125
|
+
return undefined;
|
|
126
|
+
}
|
|
127
|
+
return column.isArray ? (`_${base}` as const) : base;
|
|
128
|
+
}
|
|
129
|
+
|
|
111
130
|
/**
|
|
112
131
|
* Chooses the bulk-insert strategy for a table from its column types (ADR-0009 decision 3):
|
|
113
132
|
* - every column COPY-safe → `copy`;
|