@hoshinotatsuya/pg-replica-sync 0.2.2 → 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.
- package/CHANGELOG.md +8 -0
- package/README.md +1 -1
- package/dist/compare-lsn.d.mts +3 -3
- package/dist/compare-lsn.d.ts +3 -3
- package/dist/compare-lsn.js +3 -3
- package/dist/constants/exclusion-reason.constant.d.mts +12 -12
- package/dist/constants/exclusion-reason.constant.d.ts +12 -12
- package/dist/constants/exclusion-reason.constant.d.ts.map +1 -1
- package/dist/constants/exclusion-reason.constant.js +12 -12
- package/dist/constants/exclusion-reason.constant.js.map +1 -1
- package/dist/constants/node-role.constant.d.mts +1 -1
- package/dist/constants/node-role.constant.d.ts +1 -1
- package/dist/constants/node-role.constant.d.ts.map +1 -1
- package/dist/constants/node-role.constant.js +1 -1
- package/dist/constants/node-role.constant.js.map +1 -1
- package/dist/constants/probe-sql.constant.d.mts +25 -25
- package/dist/constants/probe-sql.constant.d.ts +25 -25
- package/dist/constants/probe-sql.constant.js +25 -25
- package/dist/constants/replica-sync-defaults.constant.d.mts +26 -26
- package/dist/constants/replica-sync-defaults.constant.d.ts +26 -26
- package/dist/constants/replica-sync-defaults.constant.d.ts.map +1 -1
- package/dist/constants/replica-sync-defaults.constant.js +26 -26
- package/dist/constants/replica-sync-defaults.constant.js.map +1 -1
- package/dist/constants/route-reason.constant.d.mts +13 -13
- package/dist/constants/route-reason.constant.d.ts +13 -13
- package/dist/constants/route-reason.constant.d.ts.map +1 -1
- package/dist/constants/route-reason.constant.js +13 -13
- package/dist/constants/route-reason.constant.js.map +1 -1
- package/dist/constants/token-format.constant.d.mts +11 -11
- package/dist/constants/token-format.constant.d.ts +11 -11
- package/dist/constants/token-format.constant.d.ts.map +1 -1
- package/dist/constants/token-format.constant.js +11 -11
- package/dist/constants/token-format.constant.js.map +1 -1
- package/dist/constants/wal-format.constant.d.mts +6 -6
- package/dist/constants/wal-format.constant.d.ts +6 -6
- package/dist/constants/wal-format.constant.d.ts.map +1 -1
- package/dist/constants/wal-format.constant.js +6 -6
- package/dist/constants/wal-format.constant.js.map +1 -1
- package/dist/decode-canonical-base64url.d.mts +1 -1
- package/dist/decode-canonical-base64url.d.ts +1 -1
- package/dist/decode-canonical-base64url.d.ts.map +1 -1
- package/dist/decode-canonical-base64url.js +1 -1
- package/dist/decode-canonical-base64url.js.map +1 -1
- package/dist/deep-freeze.d.mts +7 -7
- package/dist/deep-freeze.d.ts +7 -7
- package/dist/deep-freeze.js +9 -9
- package/dist/deep-freeze.js.map +1 -1
- package/dist/destroy-client.d.mts +3 -3
- package/dist/destroy-client.d.ts +3 -3
- package/dist/destroy-client.js +3 -3
- package/dist/evaluate-replica.d.mts +3 -3
- package/dist/evaluate-replica.d.ts +3 -3
- package/dist/evaluate-replica.js +3 -3
- package/dist/format-lsn.d.mts +1 -1
- package/dist/format-lsn.d.ts +1 -1
- package/dist/format-lsn.d.ts.map +1 -1
- package/dist/format-lsn.js +2 -2
- package/dist/format-lsn.js.map +1 -1
- package/dist/invalid-lsn.error.d.mts +1 -1
- package/dist/invalid-lsn.error.d.ts +1 -1
- package/dist/invalid-lsn.error.d.ts.map +1 -1
- package/dist/invalid-lsn.error.js +2 -2
- package/dist/invalid-lsn.error.js.map +1 -1
- package/dist/invalid-replica-sync-options.error.d.mts +1 -1
- package/dist/invalid-replica-sync-options.error.d.ts +1 -1
- package/dist/invalid-replica-sync-options.error.d.ts.map +1 -1
- package/dist/invalid-replica-sync-options.error.js +1 -1
- package/dist/invalid-replica-sync-options.error.js.map +1 -1
- package/dist/lag-bytes.d.mts +3 -3
- package/dist/lag-bytes.d.ts +3 -3
- package/dist/lag-bytes.js +3 -3
- package/dist/lsn-or-null.d.mts +1 -1
- package/dist/lsn-or-null.d.ts +1 -1
- package/dist/lsn-or-null.d.ts.map +1 -1
- package/dist/lsn-or-null.js +1 -1
- package/dist/lsn-or-null.js.map +1 -1
- package/dist/notify.d.mts +7 -7
- package/dist/notify.d.ts +7 -7
- package/dist/notify.js +8 -8
- package/dist/notify.js.map +1 -1
- package/dist/parse-lsn.d.mts +3 -3
- package/dist/parse-lsn.d.ts +3 -3
- package/dist/parse-lsn.js +3 -3
- package/dist/probe-connection-closed.error.d.mts +1 -1
- package/dist/probe-connection-closed.error.d.ts +1 -1
- package/dist/probe-connection-closed.error.d.ts.map +1 -1
- package/dist/probe-connection-closed.error.js +2 -2
- package/dist/probe-connection-closed.error.js.map +1 -1
- package/dist/probe-connection.d.mts +20 -20
- package/dist/probe-connection.d.ts +20 -20
- package/dist/probe-connection.d.ts.map +1 -1
- package/dist/probe-connection.js +25 -25
- package/dist/probe-connection.js.map +1 -1
- package/dist/probe-timeout.error.d.mts +1 -1
- package/dist/probe-timeout.error.d.ts +1 -1
- package/dist/probe-timeout.error.d.ts.map +1 -1
- package/dist/probe-timeout.error.js +2 -2
- package/dist/probe-timeout.error.js.map +1 -1
- package/dist/read-node-state.d.mts +3 -3
- package/dist/read-node-state.d.ts +3 -3
- package/dist/read-node-state.js +4 -4
- package/dist/read-node-state.js.map +1 -1
- package/dist/replica-router.d.mts +133 -133
- package/dist/replica-router.d.ts +133 -133
- package/dist/replica-router.d.ts.map +1 -1
- package/dist/replica-router.js +162 -162
- package/dist/replica-router.js.map +1 -1
- package/dist/require-integer.d.mts +1 -1
- package/dist/require-integer.d.ts +1 -1
- package/dist/require-integer.d.ts.map +1 -1
- package/dist/require-integer.js +3 -3
- package/dist/require-integer.js.map +1 -1
- package/dist/secret-weakness.d.mts +13 -13
- package/dist/secret-weakness.d.ts +13 -13
- package/dist/secret-weakness.js +16 -16
- package/dist/secret-weakness.js.map +1 -1
- package/dist/smallest-period.d.mts +4 -4
- package/dist/smallest-period.d.ts +4 -4
- package/dist/smallest-period.js +4 -4
- package/dist/sql-state-of.d.mts +6 -6
- package/dist/sql-state-of.d.ts +6 -6
- package/dist/sql-state-of.js +6 -6
- package/dist/state-cache.d.mts +14 -14
- package/dist/state-cache.d.ts +14 -14
- package/dist/state-cache.d.ts.map +1 -1
- package/dist/state-cache.js +15 -15
- package/dist/state-cache.js.map +1 -1
- package/dist/timeline-of.d.mts +2 -2
- package/dist/timeline-of.d.ts +2 -2
- package/dist/timeline-of.js +2 -2
- package/dist/to-error.d.mts +1 -1
- package/dist/to-error.d.ts +1 -1
- package/dist/to-error.d.ts.map +1 -1
- package/dist/to-error.js +1 -1
- package/dist/to-error.js.map +1 -1
- package/dist/token-codec.d.mts +10 -10
- package/dist/token-codec.d.ts +10 -10
- package/dist/token-codec.js +31 -31
- package/dist/token-codec.js.map +1 -1
- package/dist/token-lsn.d.mts +13 -13
- package/dist/token-lsn.d.ts +13 -13
- package/dist/token-lsn.js +13 -13
- package/dist/transaction-not-committed.error.d.mts +2 -2
- package/dist/transaction-not-committed.error.d.ts +2 -2
- package/dist/transaction-not-committed.error.d.ts.map +1 -1
- package/dist/transaction-not-committed.error.js +3 -3
- package/dist/transaction-not-committed.error.js.map +1 -1
- package/dist/transaction-not-open.error.d.mts +5 -5
- package/dist/transaction-not-open.error.d.ts +5 -5
- package/dist/transaction-not-open.error.js +6 -6
- package/dist/transaction-not-open.error.js.map +1 -1
- package/dist/types/cache-entry.type.d.mts +4 -4
- package/dist/types/cache-entry.type.d.ts +4 -4
- package/dist/types/clock.type.d.mts +3 -3
- package/dist/types/clock.type.d.ts +3 -3
- package/dist/types/confirm-event.type.d.mts +3 -3
- package/dist/types/confirm-event.type.d.ts +3 -3
- package/dist/types/decoded-token.type.d.mts +2 -2
- package/dist/types/decoded-token.type.d.ts +2 -2
- package/dist/types/evaluated.type.d.mts +1 -1
- package/dist/types/evaluated.type.d.ts +1 -1
- package/dist/types/evaluated.type.d.ts.map +1 -1
- package/dist/types/exclusion.type.d.mts +1 -1
- package/dist/types/exclusion.type.d.ts +1 -1
- package/dist/types/exclusion.type.d.ts.map +1 -1
- package/dist/types/node-state.type.d.mts +13 -13
- package/dist/types/node-state.type.d.ts +13 -13
- package/dist/types/node-state.type.d.ts.map +1 -1
- package/dist/types/not-a-pool.type.d.mts +5 -5
- package/dist/types/not-a-pool.type.d.ts +5 -5
- package/dist/types/probe-event.type.d.mts +1 -1
- package/dist/types/probe-event.type.d.ts +1 -1
- package/dist/types/probe-event.type.d.ts.map +1 -1
- package/dist/types/probe-outcome.type.d.mts +1 -1
- package/dist/types/probe-outcome.type.d.ts +1 -1
- package/dist/types/probe-outcome.type.d.ts.map +1 -1
- package/dist/types/probe-sample.type.d.mts +1 -1
- package/dist/types/probe-sample.type.d.ts +1 -1
- package/dist/types/probe-sample.type.d.ts.map +1 -1
- package/dist/types/replica-node.type.d.mts +7 -7
- package/dist/types/replica-node.type.d.ts +7 -7
- package/dist/types/replica-requirement.type.d.mts +2 -2
- package/dist/types/replica-requirement.type.d.ts +2 -2
- package/dist/types/replica-router-options.type.d.mts +25 -25
- package/dist/types/replica-router-options.type.d.ts +25 -25
- package/dist/types/replica-router-options.type.d.ts.map +1 -1
- package/dist/types/route-decision.type.d.mts +5 -5
- package/dist/types/route-decision.type.d.ts +5 -5
- package/dist/types/route-decision.type.d.ts.map +1 -1
- package/dist/types/router-observer.type.d.mts +5 -5
- package/dist/types/router-observer.type.d.ts +5 -5
- package/dist/types/router-observer.type.d.ts.map +1 -1
- package/dist/types/router-stats.type.d.mts +8 -8
- package/dist/types/router-stats.type.d.ts +8 -8
- package/dist/types/router-stats.type.d.ts.map +1 -1
- package/dist/types/sql-command-executor.type.d.mts +4 -4
- package/dist/types/sql-command-executor.type.d.ts +4 -4
- package/dist/types/sql-query-executor.type.d.mts +3 -3
- package/dist/types/sql-query-executor.type.d.ts +3 -3
- package/dist/types/wal-layout.type.d.mts +1 -1
- package/dist/types/wal-layout.type.d.ts +1 -1
- package/dist/types/wal-layout.type.d.ts.map +1 -1
- package/dist/types/wal-position.type.d.mts +5 -5
- package/dist/types/wal-position.type.d.ts +5 -5
- package/dist/types/wal-position.type.d.ts.map +1 -1
- package/dist/value-text.d.mts +5 -5
- package/dist/value-text.d.ts +5 -5
- package/dist/value-text.js +6 -6
- package/dist/value-text.js.map +1 -1
- package/dist/wal-layout-of.d.mts +1 -1
- package/dist/wal-layout-of.d.ts +1 -1
- package/dist/wal-layout-of.d.ts.map +1 -1
- package/dist/wal-layout-of.js +1 -1
- package/dist/wal-layout-of.js.map +1 -1
- package/package.json +11 -9
|
@@ -2,56 +2,56 @@ import type { Clock } from './clock.type.mjs';
|
|
|
2
2
|
import type { ReplicaNode } from './replica-node.type.mjs';
|
|
3
3
|
import type { RouterObserver } from './router-observer.type.mjs';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
* `undefined` (
|
|
5
|
+
* The router settings. An optional field can also be passed as
|
|
6
|
+
* `undefined` (including under `exactOptionalPropertyTypes`): that is the default.
|
|
7
7
|
*/
|
|
8
8
|
export interface ReplicaRouterOptions<TTarget> {
|
|
9
9
|
readonly primary: ReplicaNode<TTarget>;
|
|
10
|
-
/**
|
|
10
|
+
/** An empty list is allowed: all reads go to the primary (`no-replicas`). */
|
|
11
11
|
readonly replicas: readonly ReplicaNode<TTarget>[];
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
14
|
-
* (
|
|
13
|
+
* The token signing keys, not shorter than 32 bytes: the first one signs, all of them verify
|
|
14
|
+
* (rotation: the new key first, the old one after it while the issued tokens live).
|
|
15
15
|
*/
|
|
16
16
|
readonly secrets: readonly (string | Uint8Array)[];
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
19
|
-
*
|
|
18
|
+
* The lifetime ceiling of a node state in the cache, ms (`REPLICA_SYNC_DEFAULTS.STATE_TTL_MS`),
|
|
19
|
+
* not more than `MAX_STATE_TTL_MS`.
|
|
20
20
|
*/
|
|
21
21
|
readonly stateTtlMs?: number | undefined;
|
|
22
|
-
/**
|
|
22
|
+
/** The ceiling of one probe (connection + query), ms. */
|
|
23
23
|
readonly probeTimeoutMs?: number | undefined;
|
|
24
24
|
/**
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
25
|
+
* The lifetime ceiling of a probe connection that did not get established or on which a query
|
|
26
|
+
* did not answer, ms (`REPLICA_SYNC_DEFAULTS.CONNECT_TIMEOUT_MS`): until it the connection
|
|
27
|
+
* is not torn, even if the probe has already been refused by `probeTimeoutMs`.
|
|
28
28
|
*/
|
|
29
29
|
readonly connectTimeoutMs?: number | undefined;
|
|
30
|
-
/**
|
|
30
|
+
/** A node that did not answer a probe is not polled for this many ms. */
|
|
31
31
|
readonly unavailableRetryMs?: number | undefined;
|
|
32
|
-
/**
|
|
32
|
+
/** Without a token: the ceiling of a replica lag behind the primary insert position, bytes. */
|
|
33
33
|
readonly maxLagBytes?: number | undefined;
|
|
34
|
-
/**
|
|
34
|
+
/** With a token: how long to wait for catch-up before going to the primary, ms (0 — do not wait). */
|
|
35
35
|
readonly waitForCatchUpMs?: number | undefined;
|
|
36
|
-
/**
|
|
36
|
+
/** The interval of polling the replicas during the wait, ms. */
|
|
37
37
|
readonly catchUpPollMs?: number | undefined;
|
|
38
|
-
/**
|
|
38
|
+
/** No more than one new probe of a node per this many ms (0 — no ceiling). */
|
|
39
39
|
readonly minProbeIntervalMs?: number | undefined;
|
|
40
40
|
/**
|
|
41
|
-
*
|
|
42
|
-
* (
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
41
|
+
* How long a token that after a failover no replica can satisfy
|
|
42
|
+
* (another timeline, another cluster, ahead of the primary) holds reads on the
|
|
43
|
+
* primary, ms; an older one is read as without a token (`expiredTokens` in `stats()`).
|
|
44
|
+
* Unsatisfiability is proven by a primary probe started after the first encounter with the
|
|
45
|
+
* token position; a token "without a position" does not age.
|
|
46
46
|
*/
|
|
47
47
|
readonly tokenTtlMs?: number | undefined;
|
|
48
48
|
readonly observer?: RouterObserver | undefined;
|
|
49
|
-
/**
|
|
49
|
+
/** The cache clock; `performance.now` by default. It must return a finite number. */
|
|
50
50
|
readonly clock?: Clock | undefined;
|
|
51
51
|
/**
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
52
|
+
* The clock of the token issue moment — Unix epoch ms, shared by the processes that
|
|
53
|
+
* issue and read tokens; `Date.now` by default. A divergence of the process clocks
|
|
54
|
+
* shifts only the expiry of an unsatisfiable token (see `tokenTtlMs`).
|
|
55
55
|
*/
|
|
56
56
|
readonly wallClock?: Clock | undefined;
|
|
57
57
|
}
|
|
@@ -2,56 +2,56 @@ import type { Clock } from './clock.type';
|
|
|
2
2
|
import type { ReplicaNode } from './replica-node.type';
|
|
3
3
|
import type { RouterObserver } from './router-observer.type';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
* `undefined` (
|
|
5
|
+
* The router settings. An optional field can also be passed as
|
|
6
|
+
* `undefined` (including under `exactOptionalPropertyTypes`): that is the default.
|
|
7
7
|
*/
|
|
8
8
|
export interface ReplicaRouterOptions<TTarget> {
|
|
9
9
|
readonly primary: ReplicaNode<TTarget>;
|
|
10
|
-
/**
|
|
10
|
+
/** An empty list is allowed: all reads go to the primary (`no-replicas`). */
|
|
11
11
|
readonly replicas: readonly ReplicaNode<TTarget>[];
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
14
|
-
* (
|
|
13
|
+
* The token signing keys, not shorter than 32 bytes: the first one signs, all of them verify
|
|
14
|
+
* (rotation: the new key first, the old one after it while the issued tokens live).
|
|
15
15
|
*/
|
|
16
16
|
readonly secrets: readonly (string | Uint8Array)[];
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
19
|
-
*
|
|
18
|
+
* The lifetime ceiling of a node state in the cache, ms (`REPLICA_SYNC_DEFAULTS.STATE_TTL_MS`),
|
|
19
|
+
* not more than `MAX_STATE_TTL_MS`.
|
|
20
20
|
*/
|
|
21
21
|
readonly stateTtlMs?: number | undefined;
|
|
22
|
-
/**
|
|
22
|
+
/** The ceiling of one probe (connection + query), ms. */
|
|
23
23
|
readonly probeTimeoutMs?: number | undefined;
|
|
24
24
|
/**
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
25
|
+
* The lifetime ceiling of a probe connection that did not get established or on which a query
|
|
26
|
+
* did not answer, ms (`REPLICA_SYNC_DEFAULTS.CONNECT_TIMEOUT_MS`): until it the connection
|
|
27
|
+
* is not torn, even if the probe has already been refused by `probeTimeoutMs`.
|
|
28
28
|
*/
|
|
29
29
|
readonly connectTimeoutMs?: number | undefined;
|
|
30
|
-
/**
|
|
30
|
+
/** A node that did not answer a probe is not polled for this many ms. */
|
|
31
31
|
readonly unavailableRetryMs?: number | undefined;
|
|
32
|
-
/**
|
|
32
|
+
/** Without a token: the ceiling of a replica lag behind the primary insert position, bytes. */
|
|
33
33
|
readonly maxLagBytes?: number | undefined;
|
|
34
|
-
/**
|
|
34
|
+
/** With a token: how long to wait for catch-up before going to the primary, ms (0 — do not wait). */
|
|
35
35
|
readonly waitForCatchUpMs?: number | undefined;
|
|
36
|
-
/**
|
|
36
|
+
/** The interval of polling the replicas during the wait, ms. */
|
|
37
37
|
readonly catchUpPollMs?: number | undefined;
|
|
38
|
-
/**
|
|
38
|
+
/** No more than one new probe of a node per this many ms (0 — no ceiling). */
|
|
39
39
|
readonly minProbeIntervalMs?: number | undefined;
|
|
40
40
|
/**
|
|
41
|
-
*
|
|
42
|
-
* (
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
41
|
+
* How long a token that after a failover no replica can satisfy
|
|
42
|
+
* (another timeline, another cluster, ahead of the primary) holds reads on the
|
|
43
|
+
* primary, ms; an older one is read as without a token (`expiredTokens` in `stats()`).
|
|
44
|
+
* Unsatisfiability is proven by a primary probe started after the first encounter with the
|
|
45
|
+
* token position; a token "without a position" does not age.
|
|
46
46
|
*/
|
|
47
47
|
readonly tokenTtlMs?: number | undefined;
|
|
48
48
|
readonly observer?: RouterObserver | undefined;
|
|
49
|
-
/**
|
|
49
|
+
/** The cache clock; `performance.now` by default. It must return a finite number. */
|
|
50
50
|
readonly clock?: Clock | undefined;
|
|
51
51
|
/**
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
52
|
+
* The clock of the token issue moment — Unix epoch ms, shared by the processes that
|
|
53
|
+
* issue and read tokens; `Date.now` by default. A divergence of the process clocks
|
|
54
|
+
* shifts only the expiry of an unsatisfiable token (see `tokenTtlMs`).
|
|
55
55
|
*/
|
|
56
56
|
readonly wallClock?: Clock | undefined;
|
|
57
57
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"replica-router-options.type.d.ts","sourceRoot":"","sources":["../../src/types/replica-router-options.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE7D;;;GAGG;AACH,MAAM,WAAW,oBAAoB,CAAC,OAAO;IAC3C,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IACvC,
|
|
1
|
+
{"version":3,"file":"replica-router-options.type.d.ts","sourceRoot":"","sources":["../../src/types/replica-router-options.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE7D;;;GAGG;AACH,MAAM,WAAW,oBAAoB,CAAC,OAAO;IAC3C,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IACvC,6EAA6E;IAC7E,QAAQ,CAAC,QAAQ,EAAE,SAAS,WAAW,CAAC,OAAO,CAAC,EAAE,CAAC;IACnD;;;OAGG;IACH,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC,MAAM,GAAG,UAAU,CAAC,EAAE,CAAC;IACnD;;;OAGG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzC,yDAAyD;IACzD,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7C;;;;OAIG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/C,yEAAyE;IACzE,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjD,+FAA+F;IAC/F,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1C,qGAAqG;IACrG,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/C,gEAAgE;IAChE,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5C,8EAA8E;IAC9E,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjD;;;;;;OAMG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzC,QAAQ,CAAC,QAAQ,CAAC,EAAE,cAAc,GAAG,SAAS,CAAC;IAC/C,qFAAqF;IACrF,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,GAAG,SAAS,CAAC;IACnC;;;;OAIG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,KAAK,GAAG,SAAS,CAAC;CACxC"}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import type { Exclusion } from './exclusion.type.mjs';
|
|
2
2
|
import type { NodeRole } from './node-role.type.mjs';
|
|
3
3
|
import type { RouteReason } from './route-reason.type.mjs';
|
|
4
|
-
/**
|
|
4
|
+
/** Where to read: the node, its `target`, the reason and why the other replicas did not fit. */
|
|
5
5
|
export interface RouteDecision<TTarget> {
|
|
6
6
|
readonly role: NodeRole;
|
|
7
7
|
readonly node: string;
|
|
8
8
|
readonly target: TTarget;
|
|
9
9
|
readonly reason: RouteReason;
|
|
10
10
|
readonly excluded: readonly Exclusion[];
|
|
11
|
-
/**
|
|
11
|
+
/** How many replica polls went into waiting for catch-up (0 — did not wait). */
|
|
12
12
|
readonly catchUpPolls: number;
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
14
|
+
* The node is a balancer (`balanced: true`): the decision is proven about the probe server,
|
|
15
|
+
* not about the read server. Reading is allowed only after `router.confirm(decision,
|
|
16
|
+
* the read connection) === true`; otherwise from the primary.
|
|
17
17
|
*/
|
|
18
18
|
readonly mustConfirm: boolean;
|
|
19
19
|
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import type { Exclusion } from './exclusion.type';
|
|
2
2
|
import type { NodeRole } from './node-role.type';
|
|
3
3
|
import type { RouteReason } from './route-reason.type';
|
|
4
|
-
/**
|
|
4
|
+
/** Where to read: the node, its `target`, the reason and why the other replicas did not fit. */
|
|
5
5
|
export interface RouteDecision<TTarget> {
|
|
6
6
|
readonly role: NodeRole;
|
|
7
7
|
readonly node: string;
|
|
8
8
|
readonly target: TTarget;
|
|
9
9
|
readonly reason: RouteReason;
|
|
10
10
|
readonly excluded: readonly Exclusion[];
|
|
11
|
-
/**
|
|
11
|
+
/** How many replica polls went into waiting for catch-up (0 — did not wait). */
|
|
12
12
|
readonly catchUpPolls: number;
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
14
|
+
* The node is a balancer (`balanced: true`): the decision is proven about the probe server,
|
|
15
|
+
* not about the read server. Reading is allowed only after `router.confirm(decision,
|
|
16
|
+
* the read connection) === true`; otherwise from the primary.
|
|
17
17
|
*/
|
|
18
18
|
readonly mustConfirm: boolean;
|
|
19
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route-decision.type.d.ts","sourceRoot":"","sources":["../../src/types/route-decision.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,
|
|
1
|
+
{"version":3,"file":"route-decision.type.d.ts","sourceRoot":"","sources":["../../src/types/route-decision.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,gGAAgG;AAChG,MAAM,WAAW,aAAa,CAAC,OAAO;IACpC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,QAAQ,EAAE,SAAS,SAAS,EAAE,CAAC;IACxC,gFAAgF;IAChF,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B;;;;OAIG;IACH,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;CAC/B"}
|
|
@@ -2,17 +2,17 @@ import type { ConfirmEvent } from './confirm-event.type.mjs';
|
|
|
2
2
|
import type { ProbeEvent } from './probe-event.type.mjs';
|
|
3
3
|
import type { RouteDecision } from './route-decision.type.mjs';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* Observation for metrics and logs. An observer refusal does not fail the routing:
|
|
6
|
+
* an exception of a hook, a refusal of an `async` hook and a throwing getter of a hook property
|
|
7
|
+
* are swallowed.
|
|
8
8
|
*/
|
|
9
9
|
export interface RouterObserver {
|
|
10
10
|
readonly routed?: ((decision: RouteDecision<unknown>) => void) | undefined;
|
|
11
11
|
readonly probed?: ((event: ProbeEvent) => void) | undefined;
|
|
12
|
-
/**
|
|
12
|
+
/** The position after the write could not be determined — a "primary only" token is issued. */
|
|
13
13
|
readonly tokenUnresolved?: ((event: {
|
|
14
14
|
readonly error: Error;
|
|
15
15
|
}) => void) | undefined;
|
|
16
|
-
/**
|
|
16
|
+
/** The outcome of `confirm` on the read connection (confirmed or why not). */
|
|
17
17
|
readonly confirmed?: ((event: ConfirmEvent) => void) | undefined;
|
|
18
18
|
}
|
|
@@ -2,18 +2,18 @@ import type { ConfirmEvent } from './confirm-event.type';
|
|
|
2
2
|
import type { ProbeEvent } from './probe-event.type';
|
|
3
3
|
import type { RouteDecision } from './route-decision.type';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* Observation for metrics and logs. An observer refusal does not fail the routing:
|
|
6
|
+
* an exception of a hook, a refusal of an `async` hook and a throwing getter of a hook property
|
|
7
|
+
* are swallowed.
|
|
8
8
|
*/
|
|
9
9
|
export interface RouterObserver {
|
|
10
10
|
readonly routed?: ((decision: RouteDecision<unknown>) => void) | undefined;
|
|
11
11
|
readonly probed?: ((event: ProbeEvent) => void) | undefined;
|
|
12
|
-
/**
|
|
12
|
+
/** The position after the write could not be determined — a "primary only" token is issued. */
|
|
13
13
|
readonly tokenUnresolved?: ((event: {
|
|
14
14
|
readonly error: Error;
|
|
15
15
|
}) => void) | undefined;
|
|
16
|
-
/**
|
|
16
|
+
/** The outcome of `confirm` on the read connection (confirmed or why not). */
|
|
17
17
|
readonly confirmed?: ((event: ConfirmEvent) => void) | undefined;
|
|
18
18
|
}
|
|
19
19
|
//# sourceMappingURL=router-observer.type.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router-observer.type.d.ts","sourceRoot":"","sources":["../../src/types/router-observer.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAE3D;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE,aAAa,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IAC3E,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IAC5D,+
|
|
1
|
+
{"version":3,"file":"router-observer.type.d.ts","sourceRoot":"","sources":["../../src/types/router-observer.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAE3D;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE,aAAa,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IAC3E,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IAC5D,+FAA+F;IAC/F,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE;QAAE,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAA;KAAE,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IACpF,8EAA8E;IAC9E,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;CAClE"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { ExclusionReason } from './exclusion-reason.type.mjs';
|
|
2
2
|
import type { RouteReason } from './route-reason.type.mjs';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* Counters since the router was created: the share of reads from replicas and the primary,
|
|
5
|
+
* the reasons, the lag. The lag is the last measured one (bytes of WAL from the primary insert
|
|
6
|
+
* position, a number; above 2⁵³ − 1 it is this ceiling), `null` means not yet
|
|
7
|
+
* measured or not determined. The object is serialized by `JSON.stringify` as is.
|
|
8
8
|
*/
|
|
9
9
|
export interface RouterStats {
|
|
10
10
|
readonly reads: {
|
|
@@ -18,12 +18,12 @@ export interface RouterStats {
|
|
|
18
18
|
readonly failed: number;
|
|
19
19
|
};
|
|
20
20
|
readonly lagBytes: Readonly<Record<string, number | null>>;
|
|
21
|
-
/**
|
|
21
|
+
/** Tokens older than `tokenTtlMs` that would otherwise hold a read on the primary — read as without a token. */
|
|
22
22
|
readonly expiredTokens: number;
|
|
23
23
|
/**
|
|
24
|
-
* `confirm`
|
|
25
|
-
*
|
|
26
|
-
*
|
|
24
|
+
* `confirm` on the read connection: confirmed / rejected and why. A "replica"
|
|
25
|
+
* decision rejected here is already counted in `reads.replica` — the read
|
|
26
|
+
* went to the primary; without this counter the share of the primary would not be visible.
|
|
27
27
|
*/
|
|
28
28
|
readonly confirms: {
|
|
29
29
|
readonly confirmed: number;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { ExclusionReason } from './exclusion-reason.type';
|
|
2
2
|
import type { RouteReason } from './route-reason.type';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* Counters since the router was created: the share of reads from replicas and the primary,
|
|
5
|
+
* the reasons, the lag. The lag is the last measured one (bytes of WAL from the primary insert
|
|
6
|
+
* position, a number; above 2⁵³ − 1 it is this ceiling), `null` means not yet
|
|
7
|
+
* measured or not determined. The object is serialized by `JSON.stringify` as is.
|
|
8
8
|
*/
|
|
9
9
|
export interface RouterStats {
|
|
10
10
|
readonly reads: {
|
|
@@ -18,12 +18,12 @@ export interface RouterStats {
|
|
|
18
18
|
readonly failed: number;
|
|
19
19
|
};
|
|
20
20
|
readonly lagBytes: Readonly<Record<string, number | null>>;
|
|
21
|
-
/**
|
|
21
|
+
/** Tokens older than `tokenTtlMs` that would otherwise hold a read on the primary — read as without a token. */
|
|
22
22
|
readonly expiredTokens: number;
|
|
23
23
|
/**
|
|
24
|
-
* `confirm`
|
|
25
|
-
*
|
|
26
|
-
*
|
|
24
|
+
* `confirm` on the read connection: confirmed / rejected and why. A "replica"
|
|
25
|
+
* decision rejected here is already counted in `reads.replica` — the read
|
|
26
|
+
* went to the primary; without this counter the share of the primary would not be visible.
|
|
27
27
|
*/
|
|
28
28
|
readonly confirms: {
|
|
29
29
|
readonly confirmed: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router-stats.type.d.ts","sourceRoot":"","sources":["../../src/types/router-stats.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,KAAK,EAAE;QAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IACvE,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;IACjE,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;IACxE,QAAQ,CAAC,MAAM,EAAE;QAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAClE,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC;IAC3D,
|
|
1
|
+
{"version":3,"file":"router-stats.type.d.ts","sourceRoot":"","sources":["../../src/types/router-stats.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,KAAK,EAAE;QAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IACvE,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;IACjE,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;IACxE,QAAQ,CAAC,MAAM,EAAE;QAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAClE,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC;IAC3D,gHAAgH;IAChH,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,EAAE;QACjB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;QAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;QAC1B,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;KACtE,CAAC;CACH"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* (
|
|
4
|
-
*
|
|
5
|
-
*
|
|
2
|
+
* The connection on which the write transaction runs: `pg.Client` or `pg.PoolClient`
|
|
3
|
+
* (not a pool — with a pool COMMIT would go to a random connection). `command` is the answer
|
|
4
|
+
* tag: for the `COMMIT` of a transaction with an error it is `ROLLBACK`. A driver that does not report the tag
|
|
5
|
+
* fits: the transaction state before COMMIT is checked separately.
|
|
6
6
|
*/
|
|
7
7
|
export interface SqlCommandExecutor {
|
|
8
8
|
query(text: string): Promise<{
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* (
|
|
4
|
-
*
|
|
5
|
-
*
|
|
2
|
+
* The connection on which the write transaction runs: `pg.Client` or `pg.PoolClient`
|
|
3
|
+
* (not a pool — with a pool COMMIT would go to a random connection). `command` is the answer
|
|
4
|
+
* tag: for the `COMMIT` of a transaction with an error it is `ROLLBACK`. A driver that does not report the tag
|
|
5
|
+
* fits: the transaction state before COMMIT is checked separately.
|
|
6
6
|
*/
|
|
7
7
|
export interface SqlCommandExecutor {
|
|
8
8
|
query(text: string): Promise<{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* What to run a query with: `pg.Client`, `pg.PoolClient`, `pg.Pool` — or anything
|
|
3
|
+
* of the same shape. Structurally, so that a second copy of `pg` in a monorepo
|
|
4
|
+
* fits the same way.
|
|
5
5
|
*/
|
|
6
6
|
export interface SqlQueryExecutor {
|
|
7
7
|
query(text: string): Promise<{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* What to run a query with: `pg.Client`, `pg.PoolClient`, `pg.Pool` — or anything
|
|
3
|
+
* of the same shape. Structurally, so that a second copy of `pg` in a monorepo
|
|
4
|
+
* fits the same way.
|
|
5
5
|
*/
|
|
6
6
|
export interface SqlQueryExecutor {
|
|
7
7
|
query(text: string): Promise<{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/** The server WAL layout (`pg_control_init()`): the alignment, the page size and the segment size, bytes. */
|
|
2
2
|
export interface WalLayout {
|
|
3
3
|
readonly maxAlign: number;
|
|
4
4
|
readonly blockSize: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/** The server WAL layout (`pg_control_init()`): the alignment, the page size and the segment size, bytes. */
|
|
2
2
|
export interface WalLayout {
|
|
3
3
|
readonly maxAlign: number;
|
|
4
4
|
readonly blockSize: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wal-layout.type.d.ts","sourceRoot":"","sources":["../../src/types/wal-layout.type.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"wal-layout.type.d.ts","sourceRoot":"","sources":["../../src/types/wal-layout.type.ts"],"names":[],"mappings":"AAAA,6GAA6G;AAC7G,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* A WAL position of a specific cluster on a specific timeline. One position
|
|
3
|
+
* without a timeline means nothing after a failover: on a new timeline the same
|
|
4
|
+
* numbers mean other records.
|
|
5
5
|
*/
|
|
6
6
|
export interface WalPosition {
|
|
7
|
-
/** `pg_control_system().system_identifier` —
|
|
7
|
+
/** `pg_control_system().system_identifier` — shared by the primary and its replicas. */
|
|
8
8
|
readonly systemId: string;
|
|
9
9
|
readonly timeline: number;
|
|
10
|
-
/** 64
|
|
10
|
+
/** A 64-bit position (`X/Y` → X·2³² + Y). */
|
|
11
11
|
readonly lsn: bigint;
|
|
12
12
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* A WAL position of a specific cluster on a specific timeline. One position
|
|
3
|
+
* without a timeline means nothing after a failover: on a new timeline the same
|
|
4
|
+
* numbers mean other records.
|
|
5
5
|
*/
|
|
6
6
|
export interface WalPosition {
|
|
7
|
-
/** `pg_control_system().system_identifier` —
|
|
7
|
+
/** `pg_control_system().system_identifier` — shared by the primary and its replicas. */
|
|
8
8
|
readonly systemId: string;
|
|
9
9
|
readonly timeline: number;
|
|
10
|
-
/** 64
|
|
10
|
+
/** A 64-bit position (`X/Y` → X·2³² + Y). */
|
|
11
11
|
readonly lsn: bigint;
|
|
12
12
|
}
|
|
13
13
|
//# sourceMappingURL=wal-position.type.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wal-position.type.d.ts","sourceRoot":"","sources":["../../src/types/wal-position.type.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,
|
|
1
|
+
{"version":3,"file":"wal-position.type.d.ts","sourceRoot":"","sources":["../../src/types/wal-position.type.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,wFAAwF;IACxF,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,6CAA6C;IAC7C,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB"}
|
package/dist/value-text.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* `String(value)` (
|
|
4
|
-
*
|
|
5
|
-
* `Symbol.toPrimitive`
|
|
6
|
-
*
|
|
2
|
+
* The text of a thrown value that does not throw itself. An ordinary value is as
|
|
3
|
+
* `String(value)` (for an error — "Name: message"), but `String()` on a value without
|
|
4
|
+
* a prototype (`Object.create(null)`) or with a throwing `toString` /
|
|
5
|
+
* `Symbol.toPrimitive` throws a TypeError — in the branch that handles a refusal.
|
|
6
|
+
* Then `message` if it is a string, otherwise the object tag.
|
|
7
7
|
*/
|
|
8
8
|
export declare function valueText(value: unknown): string;
|
package/dist/value-text.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* `String(value)` (
|
|
4
|
-
*
|
|
5
|
-
* `Symbol.toPrimitive`
|
|
6
|
-
*
|
|
2
|
+
* The text of a thrown value that does not throw itself. An ordinary value is as
|
|
3
|
+
* `String(value)` (for an error — "Name: message"), but `String()` on a value without
|
|
4
|
+
* a prototype (`Object.create(null)`) or with a throwing `toString` /
|
|
5
|
+
* `Symbol.toPrimitive` throws a TypeError — in the branch that handles a refusal.
|
|
6
|
+
* Then `message` if it is a string, otherwise the object tag.
|
|
7
7
|
*/
|
|
8
8
|
export declare function valueText(value: unknown): string;
|
|
9
9
|
//# sourceMappingURL=value-text.d.ts.map
|
package/dist/value-text.js
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.valueText = valueText;
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
* `String(value)` (
|
|
7
|
-
*
|
|
8
|
-
* `Symbol.toPrimitive`
|
|
9
|
-
*
|
|
5
|
+
* The text of a thrown value that does not throw itself. An ordinary value is as
|
|
6
|
+
* `String(value)` (for an error — "Name: message"), but `String()` on a value without
|
|
7
|
+
* a prototype (`Object.create(null)`) or with a throwing `toString` /
|
|
8
|
+
* `Symbol.toPrimitive` throws a TypeError — in the branch that handles a refusal.
|
|
9
|
+
* Then `message` if it is a string, otherwise the object tag.
|
|
10
10
|
*/
|
|
11
11
|
function valueText(value) {
|
|
12
12
|
try {
|
|
@@ -18,7 +18,7 @@ function valueText(value) {
|
|
|
18
18
|
return typeof message === 'string' ? message : Object.prototype.toString.call(value);
|
|
19
19
|
}
|
|
20
20
|
catch {
|
|
21
|
-
return '[
|
|
21
|
+
return '[a value without text]';
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
}
|
package/dist/value-text.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"value-text.js","sourceRoot":"","sources":["../src/value-text.ts"],"names":[],"mappings":";;AAOA,8BAWC;AAlBD;;;;;;GAMG;AACH,SAAgB,SAAS,CAAC,KAAc;IACtC,IAAI,CAAC;QACH,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC;IAAC,MAAM,CAAC;QACP,IAAI,CAAC;YACH,MAAM,OAAO,GAAI,KAAsC,EAAE,OAAO,CAAC;YACjE,OAAO,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACvF,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,
|
|
1
|
+
{"version":3,"file":"value-text.js","sourceRoot":"","sources":["../src/value-text.ts"],"names":[],"mappings":";;AAOA,8BAWC;AAlBD;;;;;;GAMG;AACH,SAAgB,SAAS,CAAC,KAAc;IACtC,IAAI,CAAC;QACH,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC;IAAC,MAAM,CAAC;QACP,IAAI,CAAC;YACH,MAAM,OAAO,GAAI,KAAsC,EAAE,OAAO,CAAC;YACjE,OAAO,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACvF,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,wBAAwB,CAAC;QAClC,CAAC;IACH,CAAC;AACH,CAAC"}
|