@ultimat3/realtime 4.1.0 → 5.0.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/package.json +3 -3
- package/src/pg-wire.ts +18 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ultimat3/realtime",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"description": "Three-tier realtime: channels, live queries, local-first sync — one protocol, one mutator shape",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"test": "bun test"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@ultimat3/core": "
|
|
36
|
-
"@ultimat3/query": "
|
|
35
|
+
"@ultimat3/core": "5.0.0",
|
|
36
|
+
"@ultimat3/query": "5.0.0",
|
|
37
37
|
"nats": "2.29.3"
|
|
38
38
|
}
|
|
39
39
|
}
|
package/src/pg-wire.ts
CHANGED
|
@@ -170,13 +170,28 @@ export const describeFields = (fields: Readonly<Record<string, string>>): string
|
|
|
170
170
|
.filter((part): part is string => part !== undefined && part !== '')
|
|
171
171
|
.join(' — ');
|
|
172
172
|
|
|
173
|
-
/**
|
|
174
|
-
|
|
173
|
+
/**
|
|
174
|
+
* SQLSTATEs worth their own fix line, because the operator's next command differs for each.
|
|
175
|
+
*
|
|
176
|
+
* Exported for `pg-wire.test.ts` alone, which pins the publication name in `42704` to
|
|
177
|
+
* `DEFAULT_REPLICATION_PUBLICATION` — a test may import `changefeed-env.ts`, and this module may
|
|
178
|
+
* not: `changefeed-env -> changefeed -> pg-replication -> pg-wire` is already a chain, so reading
|
|
179
|
+
* the constant here would close it into a cycle. Not re-exported from `index.ts`.
|
|
180
|
+
*/
|
|
181
|
+
export const FIXES: Readonly<Record<string, string>> = {
|
|
175
182
|
'28P01': 'correct the password in the replication URL — the server refused the credentials',
|
|
176
183
|
'28000': 'add a `host replication <user> <cidr> scram-sha-256` line to pg_hba.conf and reload',
|
|
177
184
|
'42501': 'grant the role REPLICATION: ALTER ROLE <user> WITH REPLICATION',
|
|
178
185
|
'55006': 'another replicator holds the slot — exactly one replicator per database, by design',
|
|
179
|
-
|
|
186
|
+
// NOT `x db replication init`, which this line said until 2026-08-20 and which is not a command:
|
|
187
|
+
// `x db` takes gen, migrate, reset, seed, studio, branch and backfill. It shipped because a fix
|
|
188
|
+
// read out of a TABLE was invisible to the gate — `fix: FIXES[code]` holds no literal — which is
|
|
189
|
+
// the half of #97 that outlived the three log-injection holes. The publication is the operator's
|
|
190
|
+
// to create; the slot the replicator creates for itself on its next start.
|
|
191
|
+
'42704':
|
|
192
|
+
'psql "$REPLICATION_URL" -c "CREATE PUBLICATION x_changes FOR ALL TABLES"' +
|
|
193
|
+
" # x_changes is the default name; use REPLICATION_PUBLICATION's value where it is set. " +
|
|
194
|
+
"The slot is the replicator's own and it creates one on its next start",
|
|
180
195
|
'0A000': 'set wal_level = logical in postgresql.conf and restart the server',
|
|
181
196
|
};
|
|
182
197
|
|