@rebasepro/server-postgres 0.31.0-canary.g902a0ce → 0.32.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/dist/{BranchService-USp1AvZB.js → BranchService-C8LtpMho.js} +3 -3
- package/dist/{BranchService-USp1AvZB.js.map → BranchService-C8LtpMho.js.map} +1 -1
- package/dist/{backup-cli-DbKyEj6c.js → backup-cli-DtV6n3oB.js} +3 -3
- package/dist/{backup-cli-DbKyEj6c.js.map → backup-cli-DtV6n3oB.js.map} +1 -1
- package/dist/{boot-ddl-5H2bL_80.js → boot-ddl-CSYhSSZD.js} +2 -2
- package/dist/{boot-ddl-5H2bL_80.js.map → boot-ddl-CSYhSSZD.js.map} +1 -1
- package/dist/{cli-console-DsRgGSBR.js → cli-console-Cu1DzqvR.js} +4 -4
- package/dist/{cli-console-DsRgGSBR.js.map → cli-console-Cu1DzqvR.js.map} +1 -1
- package/dist/{cli-schema-dir-CiN0ephV.js → cli-schema-dir-DuZIsF2e.js} +5 -5
- package/dist/{cli-schema-dir-CiN0ephV.js.map → cli-schema-dir-DuZIsF2e.js.map} +1 -1
- package/dist/cli.js +124 -36
- package/dist/cli.js.map +1 -1
- package/dist/{database-preflight-bfnIBnjM.js → database-preflight-CyTCWlfc.js} +2 -2
- package/dist/{database-preflight-bfnIBnjM.js.map → database-preflight-CyTCWlfc.js.map} +1 -1
- package/dist/{deferred-index-build-CcSDA7wE.js → deferred-index-build-ueYVUBZc.js} +4 -4
- package/dist/{deferred-index-build-CcSDA7wE.js.map → deferred-index-build-ueYVUBZc.js.map} +1 -1
- package/dist/{ensure-policies-rRmXb5bt.js → ensure-policies-13mHWjBs.js} +7 -7
- package/dist/{ensure-policies-rRmXb5bt.js.map → ensure-policies-13mHWjBs.js.map} +1 -1
- package/dist/{ensure-tables-Bvm-F2wW.js → ensure-tables-B3Kh2RwT.js} +7 -7
- package/dist/{ensure-tables-Bvm-F2wW.js.map → ensure-tables-B3Kh2RwT.js.map} +1 -1
- package/dist/{ensure-tables-CC8p_AK3.js → ensure-tables-DM1U9AZK.js} +3 -3
- package/dist/{ensure-tables-CC8p_AK3.js.map → ensure-tables-DM1U9AZK.js.map} +1 -1
- package/dist/{enum-labels-kept-FlX9SHdf.js → enum-labels-kept-CJDVtX14.js} +2 -2
- package/dist/{enum-labels-kept-FlX9SHdf.js.map → enum-labels-kept-CJDVtX14.js.map} +1 -1
- package/dist/{generate-drizzle-schema-SJMXxzPI.js → generate-drizzle-schema-B-Mkf8UI.js} +2 -2
- package/dist/{generate-drizzle-schema-SJMXxzPI.js.map → generate-drizzle-schema-B-Mkf8UI.js.map} +1 -1
- package/dist/{generate-files-tlJ9_lGI.js → generate-files-8MUP8UHC.js} +2 -2
- package/dist/{generate-files-tlJ9_lGI.js.map → generate-files-8MUP8UHC.js.map} +1 -1
- package/dist/{generate-postgres-ddl-logic-B8huc03c.js → generate-postgres-ddl-logic-CQof4iFH.js} +89 -45
- package/dist/generate-postgres-ddl-logic-CQof4iFH.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.es.js +14 -14
- package/dist/{migrate-baseline-DZmekgpD.js → migrate-baseline-DnMlSDup.js} +9 -2
- package/dist/{migrate-baseline-DZmekgpD.js.map → migrate-baseline-DnMlSDup.js.map} +1 -1
- package/dist/{migrate-policy-stamps-B_acrUQB.js → migrate-policy-stamps-BpHyEFkk.js} +5 -5
- package/dist/{migrate-policy-stamps-B_acrUQB.js.map → migrate-policy-stamps-BpHyEFkk.js.map} +1 -1
- package/dist/{open-rebase-4kisUF_k.js → open-rebase-B2mAA7UE.js} +175 -38
- package/dist/open-rebase-B2mAA7UE.js.map +1 -0
- package/dist/{pg-error-utils-BT5NzGFZ.js → pg-error-utils-CpUiBkp-.js} +2 -2
- package/dist/{pg-error-utils-BT5NzGFZ.js.map → pg-error-utils-CpUiBkp-.js.map} +1 -1
- package/dist/{policy-drift-BVMyqHSa.js → policy-drift-C9xRcbsU.js} +4 -4
- package/dist/{policy-drift-BVMyqHSa.js.map → policy-drift-C9xRcbsU.js.map} +1 -1
- package/dist/{push-index-adoption-hpHTyXMR.js → push-index-adoption-D-ph6kBc.js} +2 -2
- package/dist/{push-index-adoption-hpHTyXMR.js.map → push-index-adoption-D-ph6kBc.js.map} +1 -1
- package/dist/{push-index-prebuild-Bty9F7bD.js → push-index-prebuild-DUKtH87s.js} +3 -3
- package/dist/{push-index-prebuild-Bty9F7bD.js.map → push-index-prebuild-DUKtH87s.js.map} +1 -1
- package/dist/{push-legacy-renames-bB4bM6br.js → push-legacy-renames-wLSsAg80.js} +3 -3
- package/dist/{push-legacy-renames-bB4bM6br.js.map → push-legacy-renames-wLSsAg80.js.map} +1 -1
- package/dist/{push-policy-plan-BI8U4BOD.js → push-policy-plan-I9RNoP_-.js} +3 -3
- package/dist/{push-policy-plan-BI8U4BOD.js.map → push-policy-plan-I9RNoP_-.js.map} +1 -1
- package/dist/{request-role-cli-BdRzdE87.js → request-role-cli-D9yWoeSl.js} +8 -8
- package/dist/{request-role-cli-BdRzdE87.js.map → request-role-cli-D9yWoeSl.js.map} +1 -1
- package/dist/{request-role-migration-C8aq_TO3.js → request-role-migration-DQLiYJ4c.js} +2 -2
- package/dist/{request-role-migration-C8aq_TO3.js.map → request-role-migration-DQLiYJ4c.js.map} +1 -1
- package/dist/{rls-enforcement-DB5HHj96.js → rls-enforcement-Cwh5SJRx.js} +2 -2
- package/dist/{rls-enforcement-DB5HHj96.js.map → rls-enforcement-Cwh5SJRx.js.map} +1 -1
- package/dist/schema/doctor-cli.js +5 -5
- package/dist/schema/generate-drizzle-schema.js +1 -1
- package/dist/schema/generate-postgres-ddl-logic.d.ts +51 -8
- package/dist/schema/generate-postgres-ddl.js +1 -1
- package/dist/schema/introspect-db.js +1 -1
- package/dist/services/cdc/capture-consumers.d.ts +65 -0
- package/dist/services/cdc/wal-cdc.d.ts +13 -0
- package/dist/services/realtimeService.d.ts +18 -2
- package/dist/{websocket-BevXvwfo.js → websocket-CSVNOYHC.js} +3 -3
- package/dist/{websocket-BevXvwfo.js.map → websocket-CSVNOYHC.js.map} +1 -1
- package/package.json +7 -7
- package/dist/generate-postgres-ddl-logic-B8huc03c.js.map +0 -1
- package/dist/open-rebase-4kisUF_k.js.map +0 -1
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
import { createRequire as __createRequire } from "module";
|
|
3
3
|
__createRequire(import.meta.url);
|
|
4
4
|
import { i as buildTableSearchColumnSpec } from "../search-column-BO-WND-B.js";
|
|
5
|
-
import { c as diagnoseDbError, o as deepestErrorMessage, p as parseHostInfo } from "../cli-schema-dir-
|
|
6
|
-
import { C as warnOnAnonymousGrants, S as validatePolicyPgRoles } from "../rls-enforcement-
|
|
5
|
+
import { c as diagnoseDbError, o as deepestErrorMessage, p as parseHostInfo } from "../cli-schema-dir-DuZIsF2e.js";
|
|
6
|
+
import { C as warnOnAnonymousGrants, S as validatePolicyPgRoles } from "../rls-enforcement-Cwh5SJRx.js";
|
|
7
7
|
import { i as outError, n as describeFailure, r as out, t as chalk } from "../source-VxbrQojV.js";
|
|
8
8
|
import { n as planSchema, t as pgTypeOf } from "../plan-schema-Hbtjhge3.js";
|
|
9
9
|
import { t as generateSchema } from "../generate-drizzle-schema-logic-DL7R1rAF.js";
|
|
10
10
|
import { i as renderPgType } from "../render-ddl-D4n86NHz.js";
|
|
11
11
|
import { n as loadTableSchema, r as loadTables, t as defaultDatabaseSchemaVersion } from "../load-tables-B1Re74ng.js";
|
|
12
12
|
import { r as readGeneratedSchemaDrift, t as describeSchemaDifference } from "../generated-schema-diff-DoT2dYDe.js";
|
|
13
|
-
import { i as hasDrift, r as formatPolicyDrift, t as checkPolicyDrift } from "../policy-drift-
|
|
13
|
+
import { i as hasDrift, r as formatPolicyDrift, t as checkPolicyDrift } from "../policy-drift-C9xRcbsU.js";
|
|
14
14
|
import { n as describeDeclarationDifferences, t as compareGeneratedDeclarations } from "../generated-schema-staleness-YBVq2kTn.js";
|
|
15
15
|
import { describeMismatch } from "@rebasepro/server";
|
|
16
16
|
import { DEFAULT_DATA_SOURCE_KEY, LEGACY_SCHEMA_VERSION_PREFIX, isNumericColumnType, isTemporalColumnType } from "@rebasepro/types";
|
|
@@ -1763,8 +1763,8 @@ async function runDatabasePreflight(schemaDir, databaseUrl) {
|
|
|
1763
1763
|
return "unchecked";
|
|
1764
1764
|
}
|
|
1765
1765
|
const { loadTables } = await import("../load-tables-B1Re74ng.js").then((n) => n.i);
|
|
1766
|
-
const { preflightDatabase } = await import("../database-preflight-
|
|
1767
|
-
const { readRecordedRequestRoles } = await import("../rls-enforcement-
|
|
1766
|
+
const { preflightDatabase } = await import("../database-preflight-CyTCWlfc.js");
|
|
1767
|
+
const { readRecordedRequestRoles } = await import("../rls-enforcement-Cwh5SJRx.js").then((n) => n.y);
|
|
1768
1768
|
const { cliRlsSettings } = await import("../rls-settings-CmGK2U0a.js").then((n) => n.a);
|
|
1769
1769
|
const { Pool } = await import("pg");
|
|
1770
1770
|
const pool = new Pool({ connectionString: databaseUrl });
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as __createRequire } from "module";
|
|
2
2
|
__createRequire(import.meta.url);
|
|
3
|
-
import { t as main } from "../generate-drizzle-schema-
|
|
3
|
+
import { t as main } from "../generate-drizzle-schema-B-Mkf8UI.js";
|
|
4
4
|
//#region src/schema/bin/generate-drizzle-schema.ts
|
|
5
5
|
/**
|
|
6
6
|
* The built entry point for `generate-drizzle-schema`.
|
|
@@ -193,6 +193,21 @@ export interface PolicyApplyPlan {
|
|
|
193
193
|
/** For a restrictive policy, the statements that make it deny every row instead. */
|
|
194
194
|
denying?: string[];
|
|
195
195
|
}
|
|
196
|
+
/** What the database a boot writes the policies into can hold. */
|
|
197
|
+
export interface PolicyPlanOptions {
|
|
198
|
+
/**
|
|
199
|
+
* Whether `rebase_admin` exists. Where it cannot, a policy the compiler
|
|
200
|
+
* put `TO rebase_admin` is written `TO public`. Assumed when unset.
|
|
201
|
+
*/
|
|
202
|
+
adminRoleAvailable?: boolean;
|
|
203
|
+
/**
|
|
204
|
+
* The boot made `rebase_admin_request`, granted it to the admin request
|
|
205
|
+
* roles alone, and checked the connection does not hold its
|
|
206
|
+
* privileges. Only then are the companions planned; otherwise they
|
|
207
|
+
* are left out, and the boot drops any left in the database.
|
|
208
|
+
*/
|
|
209
|
+
adminRequestRoleAvailable?: boolean;
|
|
210
|
+
}
|
|
196
211
|
/**
|
|
197
212
|
* The per-table RLS plan for the declared collections and their junctions, as
|
|
198
213
|
* executable statements — what the managed runtime applies at boot so a freshly
|
|
@@ -201,16 +216,44 @@ export interface PolicyApplyPlan {
|
|
|
201
216
|
* The same policies `policies.sql` carries, from the same plan, so boot and
|
|
202
217
|
* `db push` produce identical RLS from identical collections.
|
|
203
218
|
*/
|
|
204
|
-
export declare const planTablePolicies: (tables: readonly CompiledTable[], options?:
|
|
205
|
-
|
|
219
|
+
export declare const planTablePolicies: (tables: readonly CompiledTable[], options?: PolicyPlanOptions) => TablePolicyPlan[];
|
|
220
|
+
/**
|
|
221
|
+
* One policy as a boot writes it, as data rather than DDL: the row
|
|
222
|
+
* `pg_policies` holds for it once it is applied, plus the rule it came from.
|
|
223
|
+
*/
|
|
224
|
+
export interface PlannedPolicy {
|
|
225
|
+
schema: string;
|
|
226
|
+
table: string;
|
|
227
|
+
name: string;
|
|
228
|
+
/** `FOR …`, upper-case as `pg_policies.cmd` spells it. */
|
|
229
|
+
command: "ALL" | "SELECT" | "INSERT" | "UPDATE" | "DELETE";
|
|
230
|
+
/** PERMISSIVE policies OR together; RESTRICTIVE ones AND. */
|
|
231
|
+
permissive: boolean;
|
|
232
|
+
/** The `TO` list; `["public"]` for every role. */
|
|
233
|
+
roles: string[];
|
|
234
|
+
/** The compiled `USING` clause, or null when the policy has none. */
|
|
235
|
+
using: string | null;
|
|
236
|
+
/** The compiled `WITH CHECK` clause, or null when the policy has none. */
|
|
237
|
+
withCheck: string | null;
|
|
206
238
|
/**
|
|
207
|
-
* The
|
|
208
|
-
*
|
|
209
|
-
*
|
|
210
|
-
* are left out, and the boot drops any left in the database.
|
|
239
|
+
* The rule it compiles from: the rule's `name`, or `#<index>` into the
|
|
240
|
+
* table's rules — its declared ones first, then the ones Rebase injects.
|
|
241
|
+
* An admin-request companion carries its base policy's.
|
|
211
242
|
*/
|
|
212
|
-
|
|
213
|
-
|
|
243
|
+
ruleKey: string;
|
|
244
|
+
/** Rebase added the rule (the admin baseline, the auth table's, the tenant scope), not the author. */
|
|
245
|
+
injected: boolean;
|
|
246
|
+
/** A junction table the planner derives for a many-to-many relation, not a declared table. */
|
|
247
|
+
junction: boolean;
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Every policy a boot writes for the tables and their junctions, as data:
|
|
251
|
+
* the same policies, in the same order, as {@link planTablePolicies} renders
|
|
252
|
+
* to statements. For a caller that reasons about the policies rather than
|
|
253
|
+
* applying them — `rebase verify` reads them to find a policy Postgres would
|
|
254
|
+
* refuse to expand (42P17, "infinite recursion detected in policy").
|
|
255
|
+
*/
|
|
256
|
+
export declare const planPolicyDefinitions: (tables: readonly CompiledTable[], options?: PolicyPlanOptions) => PlannedPolicy[];
|
|
214
257
|
/**
|
|
215
258
|
* The `generated column → column it reads` edges a project's `search` blocks
|
|
216
259
|
* imply, derived from the collections alone.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __createRequire } from "module";
|
|
2
2
|
__createRequire(import.meta.url);
|
|
3
3
|
import { r as out } from "../source-VxbrQojV.js";
|
|
4
|
-
import { r as writePostgresDdl } from "../generate-files-
|
|
4
|
+
import { r as writePostgresDdl } from "../generate-files-8MUP8UHC.js";
|
|
5
5
|
import path from "path";
|
|
6
6
|
//#region src/schema/generate-postgres-ddl.ts
|
|
7
7
|
/**
|
|
@@ -2,7 +2,7 @@ import { createRequire as __createRequire } from "module";
|
|
|
2
2
|
__createRequire(import.meta.url);
|
|
3
3
|
import { n as require_arg, o as __toESM, t as promptConfirm } from "../cli-prompt-DXG0yk-h.js";
|
|
4
4
|
import { u as pinSearchPath } from "../connection-C1zXTPJq.js";
|
|
5
|
-
import { c as diagnoseDbError } from "../cli-schema-dir-
|
|
5
|
+
import { c as diagnoseDbError } from "../cli-schema-dir-DuZIsF2e.js";
|
|
6
6
|
import { a as outWarn, i as outError, r as out, t as chalk } from "../source-VxbrQojV.js";
|
|
7
7
|
import { i as readSchemaMetadata, n as isUsableFileName, r as quoteRelation, t as countRowsUpTo } from "../introspect-db-queries-BgiRQqtR.js";
|
|
8
8
|
import { a as describeRlsOffTables, c as mergeIndexModule, d as lookupCandidates, i as buildTablesMap, l as safeHostFromUrl, o as generateSchemaModules, u as classifyTables } from "../introspect-tables-Cw_A-kk4.js";
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Who still depends on the change-capture triggers.
|
|
3
|
+
*
|
|
4
|
+
* A process that streams changes from the WAL takes the capture triggers off
|
|
5
|
+
* the tables, so writes pay for no trigger and no NOTIFY. That is only safe
|
|
6
|
+
* when nobody else is still hearing changes through them: a replica that fell
|
|
7
|
+
* back to trigger capture (it found no free replication slot, say) or an older
|
|
8
|
+
* version mid-rollout is LISTENing on `rebase_cdc`, and taking the triggers
|
|
9
|
+
* away leaves it deaf — writes made anywhere else never reach its subscribers.
|
|
10
|
+
*
|
|
11
|
+
* Every realtime LISTEN connection names itself in `application_name`
|
|
12
|
+
* (`rebase-realtime:<instance id>`, then the role of the connection), which
|
|
13
|
+
* `pg_stat_activity` shows to any role, so the question is one query:
|
|
14
|
+
*
|
|
15
|
+
* - `…:cdc` — a trigger-capture LISTEN. A consumer.
|
|
16
|
+
* - `…:entity` / `…:wal` — the legacy cross-instance channel, or a WAL stream.
|
|
17
|
+
* Not a consumer.
|
|
18
|
+
* - the bare name — a version from before the connections said which they
|
|
19
|
+
* are. It may be a trigger LISTEN, so it counts as one.
|
|
20
|
+
*
|
|
21
|
+
* Anything uncertain keeps the triggers: an extra trigger costs throughput, a
|
|
22
|
+
* missing one costs correctness.
|
|
23
|
+
*/
|
|
24
|
+
import type { RawSqlRunner } from "../../security/rls-enforcement.js";
|
|
25
|
+
/** How every realtime LISTEN connection's `application_name` starts. */
|
|
26
|
+
export declare const REALTIME_LISTENER_APPLICATION_PREFIX = "rebase-realtime:";
|
|
27
|
+
/** What a realtime connection is for — the suffix after its instance's name. */
|
|
28
|
+
export type RealtimeListenerRole = "cdc" | "entity" | "wal";
|
|
29
|
+
/** The `application_name` of one of an instance's realtime connections. */
|
|
30
|
+
export declare function realtimeListenerApplicationName(instanceName: string, role: RealtimeListenerRole): string;
|
|
31
|
+
export interface ListenerSession {
|
|
32
|
+
applicationName: string | null;
|
|
33
|
+
/** `pg_stat_activity.backend_type`, when the role may see it. */
|
|
34
|
+
backendType: string | null;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Whether a session may be hearing changes through the capture triggers.
|
|
38
|
+
*
|
|
39
|
+
* @param ownInstanceName This process's `rebase-realtime:<instance id>`; its
|
|
40
|
+
* own connections never count.
|
|
41
|
+
*/
|
|
42
|
+
export declare function isTriggerCaptureConsumer(session: ListenerSession, ownInstanceName: string): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* How many other sessions on this database may depend on the capture
|
|
45
|
+
* triggers. A failed query answers `undefined` — the caller keeps the triggers.
|
|
46
|
+
*/
|
|
47
|
+
export declare function countTriggerCaptureConsumers(run: RawSqlRunner, ownInstanceName: string): Promise<number | undefined>;
|
|
48
|
+
/** How often a WAL-streaming instance that kept the triggers for another one checks whether it is gone. */
|
|
49
|
+
export declare const TRIGGER_RETIREMENT_INTERVAL_MS: number;
|
|
50
|
+
export type TriggerRetirement = {
|
|
51
|
+
removed: number;
|
|
52
|
+
}
|
|
53
|
+
/** Kept: `consumers` other sessions may depend on them, or `undefined` when that could not be read. */
|
|
54
|
+
| {
|
|
55
|
+
kept: true;
|
|
56
|
+
consumers: number | undefined;
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Take the capture triggers off the tables — unless another session may still
|
|
60
|
+
* be hearing changes through them ({@link countTriggerCaptureConsumers}).
|
|
61
|
+
*
|
|
62
|
+
* For a process that streams changes from the WAL: it does not need them, and
|
|
63
|
+
* every write pays a trigger and a NOTIFY while they stay.
|
|
64
|
+
*/
|
|
65
|
+
export declare function retireTriggerCaptureIfUnused(run: RawSqlRunner, ownInstanceName: string): Promise<TriggerRetirement>;
|
|
@@ -9,6 +9,19 @@ export declare const CDC_PUBLICATION = "rebase_cdc";
|
|
|
9
9
|
* (`rds_replication`, `cloudsqlsuperuser`) that no attribute shows.
|
|
10
10
|
*/
|
|
11
11
|
export declare function walCaptureBlocker(run: RawSqlRunner): Promise<string | undefined>;
|
|
12
|
+
/**
|
|
13
|
+
* What a boot says when it tried WAL capture and could not use it, before it
|
|
14
|
+
* falls back to the capture triggers.
|
|
15
|
+
*
|
|
16
|
+
* `REALTIME_CDC=wal` asked for the WAL, so not getting it is a warning.
|
|
17
|
+
* `auto` — the default — tries the WAL wherever it might work, and most
|
|
18
|
+
* databases are not set up for logical decoding: there, falling back is the
|
|
19
|
+
* expected outcome and an info line.
|
|
20
|
+
*/
|
|
21
|
+
export declare function walFallbackNotice(mode: "auto" | "wal"): {
|
|
22
|
+
level: "info" | "warn";
|
|
23
|
+
message: string;
|
|
24
|
+
};
|
|
12
25
|
export interface WalPublicationResult {
|
|
13
26
|
/** Tables in the publication, including ones an earlier boot added. */
|
|
14
27
|
published: CdcTableRef[];
|
|
@@ -455,8 +455,16 @@ export declare class RealtimeService extends EventEmitter implements RealtimePro
|
|
|
455
455
|
private driver?;
|
|
456
456
|
/** Unique identifier for this process instance, used to skip own notifications. */
|
|
457
457
|
private readonly instanceId;
|
|
458
|
-
/**
|
|
459
|
-
|
|
458
|
+
/**
|
|
459
|
+
* The name this instance's realtime connections report in
|
|
460
|
+
* `pg_stat_activity` (`application_name`), each followed by what the
|
|
461
|
+
* connection is for — see {@link realtimeListenerApplicationName}. Other
|
|
462
|
+
* instances count these, and a WAL-streaming one reads them to tell
|
|
463
|
+
* whether anybody still LISTENs on the capture triggers.
|
|
464
|
+
*/
|
|
465
|
+
readonly listenerInstanceName: string;
|
|
466
|
+
/** While the capture triggers are kept for another instance, the timer that retires them once it is gone. */
|
|
467
|
+
private triggerRetirementTimer?;
|
|
460
468
|
/** The LISTEN connection on {@link PG_NOTIFY_CHANNEL}, outside the Drizzle pool. */
|
|
461
469
|
private crossInstanceListener?;
|
|
462
470
|
/** Whether cross-instance broadcasting is active. */
|
|
@@ -1265,6 +1273,14 @@ export declare class RealtimeService extends EventEmitter implements RealtimePro
|
|
|
1265
1273
|
* change capture is off: the maps are built when it starts.
|
|
1266
1274
|
*/
|
|
1267
1275
|
refreshTableMaps(): void;
|
|
1276
|
+
/**
|
|
1277
|
+
* Try `retire` every `intervalMs` until it answers true — how a
|
|
1278
|
+
* WAL-streaming instance takes the capture triggers off once the last
|
|
1279
|
+
* instance still listening on them is gone. Replaces any earlier schedule;
|
|
1280
|
+
* stopped with the CDC listener.
|
|
1281
|
+
*/
|
|
1282
|
+
scheduleTriggerCaptureRetirement(retire: () => Promise<boolean>, intervalMs: number): void;
|
|
1283
|
+
private cancelTriggerCaptureRetirement;
|
|
1268
1284
|
/** Stop the CDC listener and clear its state. */
|
|
1269
1285
|
stopCdc(): Promise<void>;
|
|
1270
1286
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createRequire as __createRequire } from "module";
|
|
2
2
|
__createRequire(import.meta.url);
|
|
3
3
|
import { i as __exportAll } from "./cli-prompt-DXG0yk-h.js";
|
|
4
|
-
import { A as reapSilentSockets, at as SQL_RESULT_BYTE_BUDGET, ct as resolveNestedPath, it as sqlRoleRanAs, j as terminateIfBacklogged, k as budgetSendBuffers, lt as assertReadRequestReadable, nt as effectiveSqlRole, ot as SqlResultTooLargeError, st as isNestedPath } from "./open-rebase-
|
|
5
|
-
import { r as BranchingUnsupportedError } from "./BranchService-
|
|
4
|
+
import { A as reapSilentSockets, at as SQL_RESULT_BYTE_BUDGET, ct as resolveNestedPath, it as sqlRoleRanAs, j as terminateIfBacklogged, k as budgetSendBuffers, lt as assertReadRequestReadable, nt as effectiveSqlRole, ot as SqlResultTooLargeError, st as isNestedPath } from "./open-rebase-B2mAA7UE.js";
|
|
5
|
+
import { r as BranchingUnsupportedError } from "./BranchService-C8LtpMho.js";
|
|
6
6
|
import { ApiError, DATABASE_UNAVAILABLE_MESSAGE, RUNTIME_DEFAULT_MAX_BODY_SIZE, assertFieldOpsValid, assertNestedWriteAllowed, assertNoFieldOpsOnCreate, assertNoUserUpsert, assertUserCreationBodyValid, assertWriteRequestValid, createUserThroughAuthTable, decideImpersonation, declaredErrorAnswer, extractUserFromToken, getAccessModel, isAuthTable, isDatabaseUnreachable, logger, resolveConflictTarget, resolveRequireAuth, safeCompare } from "@rebasepro/server";
|
|
7
7
|
import { ANONYMOUS_USER_ID, ListLimitError, hasAdminRole, isSQLAdmin, isSchemaAdmin, resolveClientListLimit, scopeGrants, scopesForRoles } from "@rebasepro/types";
|
|
8
8
|
import { UnknownFilterOperatorError, deserializeFilter, redactSqlLiterals, relationOf } from "@rebasepro/common";
|
|
@@ -1709,4 +1709,4 @@ function createPostgresWebSocket(server, realtimeService, driver, authConfig, au
|
|
|
1709
1709
|
//#endregion
|
|
1710
1710
|
export { createPostgresWebSocket as a, websocket_exports as c, TOO_MANY_SOCKETS_CLOSE_CODE as i, PUBLIC_TYPES as n, isSocketRealtimeService as o, SESSION_ENDED_CLOSE_CODE as r, socketRealtimeMissing as s, ADMIN_PLANE_TYPES as t };
|
|
1711
1711
|
|
|
1712
|
-
//# sourceMappingURL=websocket-
|
|
1712
|
+
//# sourceMappingURL=websocket-CSVNOYHC.js.map
|