@pgxsinkit/contracts 0.2.7 → 0.3.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.
@@ -0,0 +1,162 @@
1
+ import { type AnyColumn } from "drizzle-orm";
2
+ /**
3
+ * The **native predicate AST** — the wire form a shape's `where` takes on the Circuits-native read
4
+ * path (ADR-0055), replacing the Electric path's SQL `where` **text**.
5
+ *
6
+ * This matters beyond serialization. The Electric path compiled a Drizzle `SQL` fragment down to a
7
+ * string that the engine then re-lexed (`where_sql.rs`); the native path never produces text at all,
8
+ * so there is no lexer on our path and no grammar to keep two implementations agreeing on. It is
9
+ * also what makes the repo's SQL-tier rule reachable at tier ① here: authoring is real column
10
+ * objects and typed values end to end, with no string to escape and nothing to interpolate.
11
+ *
12
+ * These types mirror `@electric-circuits/protocol`'s `Predicate` union exactly. They are restated
13
+ * rather than imported: this is the wire contract pgxsinkit commits to, the protocol package is
14
+ * alpha, and a published library should not put an alpha peer in its public types. Any divergence
15
+ * is a bug here — the engine's serde definitions are authoritative.
16
+ */
17
+ export type PredicateValue = string | number | boolean | null;
18
+ /**
19
+ * Comparison operators for a leaf predicate.
20
+ *
21
+ * `like` is SQL `LIKE`: case-sensitive, `%` = any sequence, `_` = any single char. There is no
22
+ * `notLike` op — the engine models it as `Not(Like)`, which is what {@link p.notLike} builds.
23
+ */
24
+ export type PredicateLeafOp = "eq" | "neq" | "lt" | "lte" | "gt" | "gte" | "like";
25
+ /** `col <op> value`. Three-valued: never TRUE on a NULL cell — use {@link IsNullPredicate} for that. */
26
+ export interface LeafPredicate {
27
+ col: string;
28
+ op: PredicateLeafOp;
29
+ value: PredicateValue;
30
+ }
31
+ /**
32
+ * `col IS NULL` / `col IS NOT NULL`. A separate leaf because it is the one test that is TRUE on a
33
+ * NULL cell, and the only two-valued one — so it is also the only leaf that composes soundly under
34
+ * {@link NotPredicate}.
35
+ */
36
+ export interface IsNullPredicate {
37
+ col: string;
38
+ isNull: boolean;
39
+ }
40
+ export interface AndPredicate {
41
+ and: Predicate[];
42
+ }
43
+ export interface OrPredicate {
44
+ or: Predicate[];
45
+ }
46
+ export interface NotPredicate {
47
+ not: Predicate;
48
+ }
49
+ /**
50
+ * The inner half of an `IN` test: the set of `project` values over `table`'s rows matching `where`.
51
+ * `where` may itself contain subquery leaves. Single column only — the engine has no composite
52
+ * `(a, b) IN (…)`. Subqueries must stay **uncorrelated**: the inner `where` references the inner
53
+ * table's columns only, never the outer row's.
54
+ */
55
+ export interface SubqueryRef<TValue extends PredicateValue = PredicateValue> {
56
+ table: string;
57
+ project: string;
58
+ where?: Predicate;
59
+ /**
60
+ * Phantom: the projected column's value type, carried so {@link p.in} can require the OUTER column
61
+ * to be comparable with what the subquery actually projects. Never serialized — it is a type-level
62
+ * marker only, which is why it is optional and never read.
63
+ */
64
+ readonly __value?: TValue;
65
+ }
66
+ /**
67
+ * `outer.col IN (SELECT project FROM table WHERE …)`, or `NOT IN` when `negated`. The engine
68
+ * maintains the inner set incrementally and shares it across every shape referencing the same
69
+ * subquery, which is why an entitlement-shaped subquery costs one index rather than one per shape.
70
+ */
71
+ export interface InSubqueryPredicate {
72
+ col: string;
73
+ in: SubqueryRef;
74
+ negated?: boolean;
75
+ }
76
+ /** A restricted boolean predicate over one table's columns, plus single-column `IN`/`NOT IN`. */
77
+ export type Predicate = LeafPredicate | IsNullPredicate | AndPredicate | OrPredicate | NotPredicate | InSubqueryPredicate;
78
+ export declare function isLeafPredicate(node: Predicate): node is LeafPredicate;
79
+ export declare function isIsNullPredicate(node: Predicate): node is IsNullPredicate;
80
+ export declare function isAndPredicate(node: Predicate): node is AndPredicate;
81
+ export declare function isOrPredicate(node: Predicate): node is OrPredicate;
82
+ export declare function isNotPredicate(node: Predicate): node is NotPredicate;
83
+ export declare function isInSubqueryPredicate(node: Predicate): node is InSubqueryPredicate;
84
+ /**
85
+ * What a builder accepts, versus {@link PredicateValue} (what goes on the wire).
86
+ *
87
+ * `bigint` is admitted because the toolkit's own timestamp convention is a **microsecond BIGINT**, so
88
+ * comparing against one is ordinary rather than exotic. It is narrowed to a number by `toWireValue`
89
+ * rather than widening the wire type: Postgres `bigint` is `ColumnType::Int` to the engine, which reads
90
+ * the JSON scalar as an `i64` — a decimal *string* would be rejected against an int column.
91
+ */
92
+ export type PredicateValueInput = PredicateValue | bigint;
93
+ /** A column's TypeScript value type, as Drizzle carries it on the column object. */
94
+ type ColumnData<TCol extends AnyColumn> = TCol["_"]["data"];
95
+ type IsAny<T> = 0 extends 1 & T ? true : false;
96
+ /**
97
+ * Whether a column's value type is statically unknowable — `any`, or the `unknown` that Drizzle's
98
+ * erased column paths (`getColumns`, `PgBuildExtraConfigColumns`) yield. Those must stay PERMISSIVE:
99
+ * narrowing an unknowable type through `Extract` collapses it to `never`, which would refuse every
100
+ * comparison on a column the author cannot re-type.
101
+ */
102
+ type IsUnknownData<T> = IsAny<T> extends true ? true : unknown extends T ? true : false;
103
+ /**
104
+ * What may be compared against `TCol` — the column's OWN value type, narrowed to what this wire can
105
+ * carry, plus `null` when the column is nullable.
106
+ *
107
+ * `Extract` is what refuses a column whose values have no scalar form at all: a `jsonb` column typed
108
+ * as an object, or a `timestamp` column typed as `Date`, resolves to `never` here, so the comparison
109
+ * is a compile error rather than the runtime throw it used to be. And because a `pgEnum` column's
110
+ * data type is the literal union of its labels, a mistyped label is caught too — something the SQL
111
+ * text form could never see.
112
+ */
113
+ export type ColumnValue<TCol extends AnyColumn> = IsUnknownData<ColumnData<TCol>> extends true ? PredicateValueInput : Extract<ColumnData<TCol>, PredicateValueInput> | (TCol["_"]["notNull"] extends true ? never : null);
114
+ /**
115
+ * The predicate builder — the tier-① authoring surface for a native `where`.
116
+ *
117
+ * Deliberately namespaced rather than exported as bare `eq`/`and`/`or`/`not`, which would collide
118
+ * with `drizzle-orm`'s operators of the same names in exactly the files that use both (a registry
119
+ * authoring RLS policies with Drizzle's `eq` and a shape `where` with this one). The shapes are
120
+ * intentionally the same so the two read alike; only the AST-versus-`SQL` return type differs.
121
+ *
122
+ * ```ts
123
+ * where: (c) => p.and(p.eq(c.published, true), p.isNotNull(c.releasedAt))
124
+ * ```
125
+ */
126
+ export declare const p: {
127
+ readonly eq: <TCol extends AnyColumn>(column: TCol, value: ColumnValue<TCol>) => LeafPredicate;
128
+ readonly ne: <TCol extends AnyColumn>(column: TCol, value: ColumnValue<TCol>) => LeafPredicate;
129
+ readonly lt: <TCol extends AnyColumn>(column: TCol, value: ColumnValue<TCol>) => LeafPredicate;
130
+ readonly lte: <TCol extends AnyColumn>(column: TCol, value: ColumnValue<TCol>) => LeafPredicate;
131
+ readonly gt: <TCol extends AnyColumn>(column: TCol, value: ColumnValue<TCol>) => LeafPredicate;
132
+ readonly gte: <TCol extends AnyColumn>(column: TCol, value: ColumnValue<TCol>) => LeafPredicate;
133
+ /** SQL `LIKE` (case-sensitive; `%` = any sequence, `_` = any single char). Text columns only. */
134
+ readonly like: <TCol extends AnyColumn<{
135
+ data: string;
136
+ }>>(column: TCol, pattern: string) => LeafPredicate;
137
+ /** SQL `NOT LIKE`. The engine has no negated-like op; it models it as `Not(Like)`, so this does too. */
138
+ readonly notLike: <TCol extends AnyColumn<{
139
+ data: string;
140
+ }>>(column: TCol, pattern: string) => NotPredicate;
141
+ readonly isNull: (column: AnyColumn) => IsNullPredicate;
142
+ readonly isNotNull: (column: AnyColumn) => IsNullPredicate;
143
+ readonly and: (...nodes: Predicate[]) => AndPredicate;
144
+ readonly or: (...nodes: Predicate[]) => OrPredicate;
145
+ readonly not: (node: Predicate) => NotPredicate;
146
+ /**
147
+ * The inner set for an `IN` test, named by the column it projects — the table is read off that
148
+ * column, so there is no table name to get wrong and no way to project a column the named table
149
+ * does not have.
150
+ */
151
+ readonly subquery: <TCol extends AnyColumn>(projected: TCol, where?: Predicate) => SubqueryRef<Extract<ColumnValue<TCol>, PredicateValue>>;
152
+ readonly in: <TCol extends AnyColumn>(column: TCol, ref: SubqueryRef<Extract<ColumnValue<TCol>, PredicateValue>>) => InSubqueryPredicate;
153
+ readonly notIn: <TCol extends AnyColumn>(column: TCol, ref: SubqueryRef<Extract<ColumnValue<TCol>, PredicateValue>>) => InSubqueryPredicate;
154
+ };
155
+ /**
156
+ * Conjoin, dropping absent branches and collapsing the trivial cases. `undefined` when nothing is
157
+ * left, which is the AST's own spelling of "all rows" (an omitted `where`) — so a caller never has
158
+ * to invent an always-true leaf to stand in for one.
159
+ */
160
+ export declare function conjoinPredicates(...nodes: (Predicate | undefined)[]): Predicate | undefined;
161
+ export {};
162
+ //# sourceMappingURL=predicate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"predicate.d.ts","sourceRoot":"","sources":["../src/predicate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgC,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAE3E;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;AAE9D;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GAAG,IAAI,GAAG,KAAK,GAAG,IAAI,GAAG,KAAK,GAAG,IAAI,GAAG,KAAK,GAAG,MAAM,CAAC;AAElF,wGAAwG;AACxG,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,EAAE,EAAE,eAAe,CAAC;IACpB,KAAK,EAAE,cAAc,CAAC;CACvB;AAED;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,SAAS,EAAE,CAAC;CAClB;AAED,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,SAAS,EAAE,CAAC;CACjB;AAED,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,SAAS,CAAC;CAChB;AAED;;;;;GAKG;AACH,MAAM,WAAW,WAAW,CAAC,MAAM,SAAS,cAAc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UAAU,IAAI,WAAW,MAAM,KAAG,YAAY;aAIhG,MAAM,WAAW,SAAS,KAAG,eAAe;aAC5C,SAAS,WAAW,SAAS,KAAG,eAAe;aAE/C,GAAG,aAAa,SAAS,EAAE,KAAG,YAAY;aAC1C,EAAE,aAAa,SAAS,EAAE,KAAG,WAAW;aACxC,GAAG,SAAS,SAAS,KAAG,YAAY;IAEpC;;;;OAIG;aACH,QAAQ,GAAG,IAAI,SAAS,SAAS,aACpB,IAAI,UACP,SAAS,KAChB,WAAW,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,cAAc,CAAC,CAAC;aAM1D,EAAE,GAAG,IAAI,SAAS,SAAS,UACjB,IAAI,OACP,WAAW,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,cAAc,CAAC,CAAC,KAC3D,mBAAmB;aACtB,KAAK,GAAG,IAAI,SAAS,SAAS,UACpB,IAAI,OACP,WAAW,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,cAAc,CAAC,CAAC,KAC3D,mBAAmB;CAKd,CAAC;AAEX;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,KAAK,EAAE,CAAC,SAAS,GAAG,SAAS,CAAC,EAAE,GAAG,SAAS,GAAG,SAAS,CAK5F"}
@@ -79,7 +79,7 @@ export declare function asEphemeral<TEntry extends SyncTableEntry>(entry: TEntry
79
79
  *
80
80
  * Throws, naming the divergent tables, on any mismatch. Call it where the client registries are assembled
81
81
  * (module-eval or a test) so a drifted projection fails closed instead of silently serving different rows
82
- * to different clients. The `customWhere` body is invisible to the fingerprint — bump
82
+ * to different clients. The `customPredicate` body is invisible to the fingerprint — bump
83
83
  * {@link RowFilterSpec.revision} so a logic-only divergence is caught.
84
84
  */
85
85
  export declare function assertReadContractPreserved(authoritative: SyncTableRegistry, projection: SyncTableRegistry, options?: {
@@ -1 +1 @@
1
- {"version":3,"file":"registry-diff.d.ts","sourceRoot":"","sources":["../src/regist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E,iBAAiB,EAAE,IAAI,EAAE,iBAAiB,GAAG,YAAY,CAOpG;AAED,6DAA6D;AAC7D,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,iBAAiB,EAAE,IAAI,EAAE,YAAY,GAAG,YAAY,CAOrG;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE;IAAE,QAAQ,EAAE,iBAAiB,CAAC;IAAC,IAAI,EAAE,YAAY,CAAA;CAAE,GAAG;IAC5F,EAAE,EAAE,OAAO,CAAC;IACZ,IAAI,EAAE,YAAY,CAAC;CACpB,CAGA;AAED,wEAAwE;AACxE,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,YAAY,GAAG,MAAM,CAKhE"}
@@ -1,4 +1,5 @@
1
- import { type JwtClaims, type RowFilterShape } from "./config";
1
+ import { type JwtClaims } from "./config";
2
+ import { type Predicate } from "./predicate";
2
3
  import { type SyncTableEntry, type SyncTableRegistry } from "./registry";
3
4
  /**
4
5
  * Registry invariants (ADR-0052): assert a claim about the RENDERED authorization artifacts of every entry
@@ -8,7 +9,7 @@ import { type SyncTableEntry, type SyncTableRegistry } from "./registry";
8
9
  * It exists because a privacy/visibility invariant spanning many entries drifts in two structural ways that
9
10
  * per-entry review cannot catch:
10
11
  *
11
- * 1. **Read/write asymmetry** — the Electric row filter and the Postgres RLS policies are two engines, so one
12
+ * 1. **Read/write asymmetry** — the shape's row filter and the Postgres RLS policies are two engines, so one
12
13
  * can be tightened (or loosened) without the other. The assertion audits BOTH surfaces of every bound
13
14
  * entry in one predicate, so "readable but unwritable" (or the reverse) is a test failure, not a bug report.
14
15
  * 2. **Under-enumeration** — an invariant expressed over a hand-maintained list of tables silently stops
@@ -16,10 +17,18 @@ import { type SyncTableEntry, type SyncTableRegistry } from "./registry";
16
17
  * inverts that: with a declared `rowClasses` vocabulary, a new entry cannot even be registered without
17
18
  * being classified, so it joins its class's invariants by construction.
18
19
  *
19
- * It audits RENDERED output, so it sees things the fingerprint structurally cannot (the `customWhere` BODY
20
- * is a closure — only its presence and `RowFilterSpec.revision` are hashed). The trade: it sees exactly the
21
- * claims fixtures you give it, and nothing else.
20
+ * It audits RESOLVED output, so it sees things the fingerprint structurally cannot (the `customPredicate`
21
+ * BODY is a closure — only its presence and `RowFilterSpec.revision` are hashed). The trade: it sees exactly
22
+ * the claims fixtures you give it, and nothing else.
22
23
  */
24
+ /**
25
+ * Whether a predicate admits no row at all — the read half of "this persona sees nothing".
26
+ *
27
+ * Recognises the {@link DENY_ALL_PREDICATE} singleton by reference AND any structurally empty `or`,
28
+ * because both are always-FALSE on the wire and an invariant is asking about the outcome, not about
29
+ * which spelling produced it.
30
+ */
31
+ export declare function deniesAllRows(predicate: Predicate | null): boolean;
23
32
  /** One rendered write policy on a bound entry's Postgres table, as the invariant predicate sees it. */
24
33
  export interface RenderedPolicy {
25
34
  /** The policy name as declared (e.g. `widgets_select_owner_or_admin`). */
@@ -42,16 +51,19 @@ export interface RegistryInvariantCell {
42
51
  fixtureName: string;
43
52
  claims: JwtClaims;
44
53
  /**
45
- * The read filter this entry sends to Electric FOR THESE CLAIMS — the real read pipeline's output
46
- * (`buildRowFilterShape`, exactly what the proxy calls per shape request).
54
+ * The read predicate this entry resolves to FOR THESE CLAIMS — the real read pipeline's output, exactly
55
+ * what the control plane compiles into the shape at subscribe.
47
56
  *
48
57
  * `null` means **unfiltered**, and covers both ways that arises: the entry declares no shape/`rowFilter`
49
- * at all, or its `customWhere` returned `null` for these claims (the documented "bypass filtering, every
50
- * row is visible" answer — e.g. an admin persona). Both are the same statement about what the client
51
- * receives, which is what an invariant reasons about; distinguish them via `entry.shape?.rowFilter` if a
52
- * predicate genuinely needs to.
58
+ * at all, or its `customPredicate` returned `null` for these claims (the documented "bypass filtering,
59
+ * every row is visible" answer — e.g. an admin persona). Both are the same statement about what the
60
+ * client receives, which is what an invariant reasons about; distinguish them via
61
+ * `entry.shape?.rowFilter` if a predicate genuinely needs to.
62
+ *
63
+ * An AST, not SQL text: an invariant matches on structure ({@link deniesAllRows}, the `isXPredicate`
64
+ * guards) rather than on a rendered string that could drift on formatting alone.
53
65
  */
54
- renderedWhere: RowFilterShape | null;
66
+ readPredicate: Predicate | null;
55
67
  /** Every RLS policy attached to the entry's Postgres table, rendered to inline SQL text. */
56
68
  renderedPolicies: RenderedPolicy[];
57
69
  }
@@ -90,8 +102,8 @@ export interface RegistryInvariantSpec {
90
102
  * name: "private rows are never visible to an anonymous caller",
91
103
  * appliesTo: ["private"],
92
104
  * claimsFixtures: { anonymous: {}, member: { sub: "u-1" } },
93
- * holds: ({ fixtureName, renderedWhere }) =>
94
- * fixtureName !== "anonymous" || renderedWhere?.where === "false" || "anonymous read is not denied",
105
+ * holds: ({ fixtureName, readPredicate }) =>
106
+ * fixtureName !== "anonymous" || deniesAllRows(readPredicate) || "anonymous read is not denied",
95
107
  * });
96
108
  * ```
97
109
  *
@@ -1 +1 @@
1
- {"version":3,"file":"registry-invariant.d.ts","sourceRoot":"","sources":["../src/registry-invariant.ts"],"names":[],"mappings":"AAGA,OAAO,EAAuB,KAAK,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,UAAU,CAAC;AACpF,OAAO,EAA6B,KAAK,cAAc,EAAE,KAAK,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpG;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,uGAAuG;AACvG,MAAM,WAAW,cAAc;IAC7B,0EAA0E;IAC1E,IAAI,EAAE,MAAM,CAAC;IACb,2GAA2G;IAC3G,OAAO,EAAE,MAAM,CAAC;IAChB,kGAAkG;IAClG,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,uGAAuG;IACvG,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED,mGAAmG;AACnG,MAAM,WAAW,qBAAqB;IACpC,uCAAuC;IACvC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,cAAc,CAAC;IACtB,mHAAmH;IACnH,QAAQ,EAAE,MAAM,GAAG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OAAO,EAAE,MAAM,CAAC;IAChB,kGAAkG;IAClG,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,uGAAuG;IACvG,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED,mGAAmG;AACnG,MAAM,WAAW,qBAAqB;IACpC,uCAAuC;IACvC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,cAAc,CAAC;IACtB,mHAAmH;IACnH,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,uFAAuF;IACvF,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,SAAS,CAAC;IAClB;;;;;;;;;;;;OAYG;IACH,aAAa,EAAE,SAAS,GAAG,IAAI,CAAC;IAChC,4FAA4F;IAC5F,gBAAgB,EAAE,cAAc,EAAE,CAAC;CACpC;AAED,MAAM,WAAW,qBAAqB;IACpC,4GAA4G;IAC5G,IAAI,EAAE,MAAM,CAAC;IACb;;;;;OAKG;IACH,SAAS,EAAE,SAAS,MAAM,EAAE,GAAG,CAAC,CAAC,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC;IACjF;;;OAGG;IACH,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAC1C;;;;OAIG;IACH,KAAK,EAAE,CAAC,IAAI,EAAE,qBAAqB,KAAK,OAAO,GAAG,MAAM,CAAC;CAC1D;AA6CD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,iBAAiB,EAAE,IAAI,EAAE,qBAAqB,GAAG,IAAI,CAyDtG"}
@@ -1,4 +1,4 @@
1
- import type { ColumnBuilderBase, InferInsertModel, InferSelectModel } from "drizzle-orm";
1
+ import type { AnyColumn, ColumnBuilderBase, InferInsertModel, InferSelectModel } from "drizzle-orm";
2
2
  import { type AnyPgTable, type PgBigInt64Builder, type PgBuildColumns, type PgBuildExtraConfigColumns, type PgPolicy, type PgTableExtraConfigValue, type PgTableWithColumns, type PgVarcharBuilder, type PgView, type PgViewWithSelection, type SetNotNull } from "drizzle-orm/pg-core";
3
3
  import type { pgSchema } from "drizzle-orm/pg-core";
4
4
  import type { ExtractTablesWithRelations } from "drizzle-orm/relations";
@@ -6,6 +6,7 @@ import { getColumns } from "drizzle-orm/utils";
6
6
  import { type ApplyStrategy, type SyncColumnType } from "./apply-strategy";
7
7
  import { type ClientProjectionSpec, type ConflictPolicy, type DeferrableConstraintSpec, type ManagedFieldApplyOn, type ManagedFieldSpec, type ManagedFieldStrategy, type PrimaryKeySpec, type Retention, type RowFilterSpec, type ServerProjectionSpec, type ShapeSpec, type ShapeSpecInput, type SubscriptionTiming, type SyncStorageDeclaration, type TableGovernanceSpec as TableGovernanceSpecBase, type TableMode, type WriteMode } from "./config";
8
8
  import { type EventStreamRegistry } from "./event-stream";
9
+ import type { Predicate } from "./predicate";
9
10
  type PgSchemaType = ReturnType<typeof pgSchema>;
10
11
  type AnyPgView = PgView;
11
12
  type TableColumnsShape<TTable extends AnyPgTable> = TTable extends {
@@ -53,12 +54,19 @@ export interface SyncTableEntry<TTable extends AnyPgTable = AnyPgTable, TLocalTa
53
54
  mode: TableMode;
54
55
  primaryKey: PrimaryKeySpec;
55
56
  /**
56
- * CDC insert-apply policy (ADR-0045). Default `"insert"`: a server CDC `insert` is applied as a plain
57
- * INSERT, so a genuine primary-key collision surfaces (the ADR-0014 collision-surfacing invariant).
58
- * `"upsert"`: this table legitimately receives locally-derived provisional rows (e.g. written by a
59
- * local trigger from another synced table), so server CDC inserts are applied idempotently as
60
- * `INSERT … ON CONFLICT (pk) DO UPDATE` — the authoritative server row overwrites the provisional
61
- * local row instead of failing the commit. Resolved to `"insert"` when omitted.
57
+ * **Backfill** conflict policy (ADR-0045). Resolved to `"insert"` when omitted.
58
+ *
59
+ * This no longer selects how steady-state changes apply. The engine emits `upsert`, which states a
60
+ * row's value without claiming it is new, so every streamed change now applies as `INSERT … ON
61
+ * CONFLICT (pk) DO UPDATE` regardless of this setting. ADR-0014's plain-INSERT collision surfacing
62
+ * went with the `insert` verb it depended on.
63
+ *
64
+ * What survives is the **initial load**, which is a different question: a fresh subscription or a
65
+ * post-must-refetch re-snapshot lands on a table assumed empty, which is what lets it use COPY or a
66
+ * plain multi-row INSERT — neither of which can express `ON CONFLICT`. Set `"upsert"` when that
67
+ * assumption does not hold for this table, i.e. it legitimately receives locally-DERIVED provisional
68
+ * rows (e.g. a local trigger on another synced table inserts one here) that a backfill could meet.
69
+ * The backfill then takes the conflict-tolerant applier instead, at the cost of the faster path.
62
70
  */
63
71
  applyMode: "insert" | "upsert";
64
72
  /**
@@ -91,12 +99,12 @@ export interface SyncTableEntry<TTable extends AnyPgTable = AnyPgTable, TLocalTa
91
99
  */
92
100
  conflictPolicy?: ConflictPolicy;
93
101
  /**
94
- * Consistency group (ADR-0009 decision 2). Tables sharing a `consistencyGroup` are synced on one
95
- * `MultiShapeStream` and committed atomically at a shared LSN frontier, so a local reader never
96
- * sees one grouped table advanced past another for the same server transaction. Omitted → the
97
- * table is its own singleton group (independent frontier, no cross-table atomicity — the resolution
98
- * for a table that declares no group). The latency cost (a group advances only as fast as its
99
- * slowest shape) is contained to the tables that opt in.
102
+ * Consistency group (ADR-0009 decision 2). Tables sharing a `consistencyGroup` are synced as one set
103
+ * of streams and committed atomically — held until every stream reports up-to-date, then applied in
104
+ * one transaction (ADR-0056) — so a local reader never sees one grouped table advanced past another
105
+ * for the same server transaction. Omitted → the table is its own singleton group (its own stream, no
106
+ * cross-table atomicity — the resolution for a table that declares no group). The latency cost (a
107
+ * group advances only as fast as its slowest shape) is contained to the tables that opt in.
100
108
  */
101
109
  consistencyGroup?: string;
102
110
  /**
@@ -191,13 +199,29 @@ export type SyncTableInputProjection<TColumns extends Record<string, ColumnBuild
191
199
  /**
192
200
  * A row filter for {@link defineSyncTable}'s `shape`, authored from the table's built, typed columns.
193
201
  * Reference columns through `c(columns.x)` exactly as `extras` does with its `self` argument, so
194
- * `customWhere` builds parameterized Electric `where`s from real, rename-safe column objects instead
202
+ * `customPredicate` builds the shape's predicate from real, rename-safe column objects instead
195
203
  * of hand-written column-name strings.
196
204
  */
197
205
  export type RowFilterInput<TColumns extends Record<string, ColumnBuilderBase>> = (columns: PgBuildExtraConfigColumns<TColumns>) => RowFilterSpec;
198
- /** {@link ShapeSpecInput} whose `rowFilter` is authored from the built columns (typed by `TColumns`). */
199
- export type ShapeSpecInputFor<TColumns extends Record<string, ColumnBuilderBase>> = Omit<ShapeSpecInput, "rowFilter"> & {
206
+ /**
207
+ * The scope declaration for a SHARED-tier shape (ADR-0055), authored from the built, typed columns —
208
+ * the columns whose values key the shape family, in the order they parameterize it.
209
+ *
210
+ * Returning real column objects rather than names is what makes the family rename-safe: a renamed
211
+ * column moves the scope with it, where a string would have gone on naming a column that no longer
212
+ * exists and silently produced a predicate over nothing.
213
+ */
214
+ export type ScopeInput<TColumns extends Record<string, ColumnBuilderBase>> = (columns: PgBuildExtraConfigColumns<TColumns>) => readonly AnyColumn[];
215
+ /**
216
+ * The static, subscriber-independent half of a shape's native predicate, authored from the built,
217
+ * typed columns. Build it with {@link p} — `(c) => p.eq(c.published, true)`.
218
+ */
219
+ export type ShapeWhereInput<TColumns extends Record<string, ColumnBuilderBase>> = (columns: PgBuildExtraConfigColumns<TColumns>) => Predicate;
220
+ /** {@link ShapeSpecInput} whose callbacks are authored from the built columns (typed by `TColumns`). */
221
+ export type ShapeSpecInputFor<TColumns extends Record<string, ColumnBuilderBase>> = Omit<ShapeSpecInput, "rowFilter" | "scope" | "where"> & {
200
222
  rowFilter?: RowFilterInput<TColumns>;
223
+ scope?: ScopeInput<TColumns>;
224
+ where?: ShapeWhereInput<TColumns>;
201
225
  };
202
226
  /**
203
227
  * Input for `defineSyncTable`. Supply `tableName + makeColumns` — the Drizzle table
@@ -239,14 +263,13 @@ export type SyncTableInput<TName extends string, TColumns extends Record<string,
239
263
  columns: string[];
240
264
  };
241
265
  /**
242
- * CDC insert-apply policy (ADR-0045). **Default `"insert"`** — a CDC insert is a plain INSERT, so a
243
- * genuine PK collision must surface (the ADR-0014 collision-surfacing invariant; a synced cache table
244
- * is server-authoritative and a duplicate insert is a real bug). Set `"upsert"` **only** when this
245
- * table legitimately receives locally-DERIVED provisional rows — e.g. a local trigger on another
246
- * synced table inserts a provisional row here, and the server independently creates the same row so
247
- * its CDC insert would collide (23505). With `"upsert"`, server CDC inserts are applied idempotently
248
- * as `INSERT … ON CONFLICT (pk) DO UPDATE`; the authoritative server row overwrites the provisional
249
- * local row. Declare the exception here, where it lives — do not weaken the invariant repo-wide.
266
+ * **Backfill** conflict policy (ADR-0045). **Default `"insert"`** — the initial load assumes an empty
267
+ * table (fresh subscription or post-must-refetch re-snapshot) and takes the fast path, COPY or a plain
268
+ * multi-row INSERT, neither of which can express `ON CONFLICT`. Set `"upsert"` **only** when this table
269
+ * legitimately receives locally-DERIVED provisional rows a backfill could land on top of — e.g. a local
270
+ * trigger on another synced table inserts a provisional row here, and the server independently creates
271
+ * the same row (23505). Steady-state changes are unaffected: the engine emits `upsert`, so they apply
272
+ * as `INSERT … ON CONFLICT (pk) DO UPDATE` for every table. See {@link SyncTableEntry.applyMode}.
250
273
  */
251
274
  applyMode?: "insert" | "upsert";
252
275
  /**
@@ -267,8 +290,8 @@ export type SyncTableInput<TName extends string, TColumns extends Record<string,
267
290
  */
268
291
  conflictPolicy?: ConflictPolicy;
269
292
  /**
270
- * Bind this table into a consistency group (ADR-0009 decision 2): grouped tables sync on one
271
- * `MultiShapeStream` and commit atomically. Omit for the default singleton group. See
293
+ * Bind this table into a consistency group (ADR-0009 decision 2): grouped tables sync as one set of
294
+ * streams and commit atomically. Omit for the default singleton group. See
272
295
  * {@link SyncTableEntry.consistencyGroup}.
273
296
  */
274
297
  consistencyGroup?: string;
@@ -732,7 +755,7 @@ export declare function defineSyncTable<const TName extends string, const TColum
732
755
  * not the jsonb), while the learner keeps reading the full table through the owner's shape.
733
756
  *
734
757
  * It is the *obvious, DRY* way to express "another shape over this table", versus the bare
735
- * `shape.electricTable` string it replaces (a footgun — config that silently un-asserts table
758
+ * `shape.physicalTable` string it replaces (a footgun — config that silently un-asserts table
736
759
  * ownership):
737
760
  *
738
761
  * - **Owns nothing.** The returned entry's `table` IS `owner.table` (the same object), so there is no
@@ -740,17 +763,17 @@ export declare function defineSyncTable<const TName extends string, const TColum
740
763
  * and `shape` are its own. `readProjection` is set so generators skip it.
741
764
  * - **DRY columns.** `columns` is a typed subset of the owner's column keys; the local table is built by
742
765
  * filtering the owner's own column definitions (never restated), and the same subset becomes the
743
- * Electric `columns` allow-list so an omitted (e.g. heavy jsonb) column never crosses the wire. The
766
+ * shape's `columns` allow-list so an omitted (e.g. heavy jsonb) column never crosses the wire. The
744
767
  * primary key is always kept. Omit `columns` to sync every column.
745
- * - **Source is derived, never named.** The physical Electric target is taken from the owner — there is
746
- * no consumer-facing source field to get wrong (see {@link ShapeSpec.electricTable}).
747
- * - **Readonly.** A projection has no write path; the engine resolves an incoming shape request by its
748
- * unique `shapeKey` (= `as`) and consults the derived physical target only on egress.
768
+ * - **Source is derived, never named.** The physical source table is taken from the owner — there is
769
+ * no consumer-facing source field to get wrong (see {@link ShapeSpec.physicalTable}).
770
+ * - **Readonly.** A projection has no write path; the control plane resolves an incoming subscription by
771
+ * its unique `shapeKey` (= `as`) and consults the derived physical target when it creates the shape.
749
772
  *
750
- * The `rowFilter` callback receives the OWNER's full columns — `customWhere` runs in Electric against
773
+ * The `rowFilter` callback receives the OWNER's full columns — the predicate is evaluated against
751
774
  * the physical table, so it may reference a column the local subset omits. RLS for the projection's
752
775
  * reads lives on the OWNER's table (a projection adds no DDL to a table it does not own); its
753
- * `customWhere` must be a subset of what that RLS allows.
776
+ * `customPredicate` must be a subset of what that RLS allows.
754
777
  *
755
778
  * The `owner` may be a `defineSyncTable` entry OR an `asReadonly` of one — an `asReadonly` projection
756
779
  * preserves the full read contract (physical table, columns, primary key) and only drops the write path,
@@ -760,15 +783,16 @@ export declare function defineSyncTable<const TName extends string, const TColum
760
783
  * ### Server-side egress redaction (`serverProjection` + `serverOnlyColumns`)
761
784
  *
762
785
  * A projection may carry its own `serverProjection` (a {@link ServerProjectionSpec}, typically a
763
- * `rowTransform`) — resolved by the projection's `shapeKey` and run on the proxy egress path for this
764
- * shape only. The order on egress is **transform first, then omission**: the transform runs against the
765
- * fetched row, then column omission strips this projection's omitted columns (the client keep-set is
766
- * `columns ∪ primaryKey`) before the row reaches the client wire. This lets a "secure window" over a
767
- * keyed table stream the body while stripping the keys per row.
786
+ * `rowTransform`) — resolved by the projection's `shapeKey` and run at the STREAM EDGE, per request, for
787
+ * this shape only (ADR-0055 decision 5). The order on egress is **transform first, then omission**: the
788
+ * transform runs against the fetched row, then the edge strips the row to the client keep-set
789
+ * (`columns ∪ primaryKey`) before it reaches the client wire. This lets a "secure window" over a keyed
790
+ * table stream the body while stripping the keys per row. Such a shape is private-tier by construction
791
+ * (its bytes depend on the reader) and is answered `cache-control: private, no-store`.
768
792
  *
769
793
  * `serverOnlyColumns` are owner column keys the transform must READ but that are NOT in the client shape
770
794
  * (e.g. a `keysWithheld` control flag). Such a key stays omitted from the client keep-set, yet is ADDED
771
- * to the Electric fetch allow-list — so it is fetched from Electric, visible to the transform, and then
795
+ * to the shape's `columns` allow-list — so it is fetched, visible to the transform, and then
772
796
  * stripped on egress by the same omission pass, never reaching the client. It requires a
773
797
  * `serverProjection.rowTransform` (a fetch no transform reads is dead weight) AND `columns` (with
774
798
  * `columns` omitted every column is already kept, so "server-only" is a contradiction), and must be
@@ -790,7 +814,7 @@ export declare function defineSyncTable<const TName extends string, const TColum
790
814
  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: {
791
815
  /** The projection's distinct local identity — its PGlite table name AND its `shapeKey`. */
792
816
  as: TAs;
793
- /** Column keys (of the owner) to sync locally + fetch from Electric. The PK is always kept. Omit → all. */
817
+ /** Column keys (of the owner) to sync locally + fetch on the shape. The PK is always kept. Omit → all. */
794
818
  columns?: TColumns;
795
819
  /** Row filter for this shape; the callback form receives the owner's full (physical) columns. */
796
820
  rowFilter?: (columns: TableColumnsShape<TOwnerTable>) => RowFilterSpec;
@@ -810,8 +834,8 @@ export declare function defineReadProjection<const TOwnerTable extends AnyPgTabl
810
834
  serverProjection?: ServerProjectionSpec | "unredacted";
811
835
  /**
812
836
  * Owner column keys the `serverProjection.rowTransform` must READ but which are NOT part of the client
813
- * shape (e.g. a `keysWithheld` control flag). They are added to the Electric fetch allow-list so the
814
- * transform can see them, then stripped on egress before the client wire. Requires
837
+ * shape (e.g. a `keysWithheld` control flag). They are added to the shape's `columns` allow-list so
838
+ * the transform can see them, then stripped on egress before the client wire. Requires
815
839
  * `serverProjection.rowTransform` and `columns`; must be disjoint from `columns` and the primary key.
816
840
  */
817
841
  serverOnlyColumns?: readonly TableColumnKey<TOwnerTable>[];
@@ -1 +1 @@
1
- {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACzF,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;AACx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