@catalyst-cloud/schema 0.1.2 → 0.1.3
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/package.json +1 -1
- package/src/index.ts +7 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@catalyst-cloud/schema",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Typed Drizzle schema = single source of truth for the per-tenant Mirror DO SQLite store (CTC-13 / ADR-0002). Shared by the mirror Worker, the host-sync replica, and the browser OPFS replica.",
|
|
6
6
|
"license": "MIT",
|
package/src/index.ts
CHANGED
|
@@ -96,6 +96,11 @@ export interface TableMeta {
|
|
|
96
96
|
pk: string[];
|
|
97
97
|
/** True iff the table carries a soft-delete `removed_at` column (delete sets it; else hard-delete). */
|
|
98
98
|
softDelete: boolean;
|
|
99
|
+
/** Every SQL column name for this table (getTableConfig-derived, drift-proof). The forward-compat
|
|
100
|
+
* default `knownColumns` in @catalyst-cloud/replicate: a delta row key not in this set is a column
|
|
101
|
+
* the mirror added ahead of this client's bundled schema, and is dropped rather than crashing the
|
|
102
|
+
* apply (#127 server-ahead skew). */
|
|
103
|
+
columns: string[];
|
|
99
104
|
}
|
|
100
105
|
|
|
101
106
|
/** Derive a table's PK columns + soft-delete posture from the Drizzle definition (no hand-maintenance). */
|
|
@@ -107,7 +112,8 @@ export function tableMeta(table: SQLiteTable): TableMeta {
|
|
|
107
112
|
const compositePk = cfg.primaryKeys.flatMap((pk) => pk.columns.map((c) => c.name));
|
|
108
113
|
const pk = singlePk.length > 0 ? singlePk : compositePk;
|
|
109
114
|
const softDelete = cfg.columns.some((c) => c.name === "removed_at");
|
|
110
|
-
|
|
115
|
+
const columns = cfg.columns.map((c) => c.name);
|
|
116
|
+
return { pk, softDelete, columns };
|
|
111
117
|
}
|
|
112
118
|
|
|
113
119
|
/** Schema-derived replication metadata for every change-feed entity, keyed by wire `entity` name. */
|