@voltro/sql-mssql 0.33.0 → 0.34.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 +1801 -0
- package/dist/index.d.ts +61 -3
- package/dist/index.js +232 -183
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -62,9 +62,11 @@ export declare interface ChangeTrackingCdcOptions {
|
|
|
62
62
|
* 2. Discrete `host`/`port`/`username`/`password`/`database`
|
|
63
63
|
* 3. Defaults: server `localhost`, port 1433
|
|
64
64
|
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
65
|
+
* TLS: an explicit `config.ssl` wins; otherwise the URL query decides (see
|
|
66
|
+
* `sslFromUrlQuery`); otherwise unset — plaintext, the driver's default.
|
|
67
|
+
* `ssl: true` becomes `encrypt: true` + `trustServer: true`, which is what
|
|
68
|
+
* `sslmode=require` means on tedious and is what lets the docker SQL Server
|
|
69
|
+
* Developer edition's self-signed certificate work.
|
|
68
70
|
*/
|
|
69
71
|
export declare const connectionFromConfig: (config: ConnectionConfig) => MssqlConnection;
|
|
70
72
|
|
|
@@ -94,9 +96,39 @@ export declare interface MssqlConnection {
|
|
|
94
96
|
readonly database?: string;
|
|
95
97
|
readonly username?: string;
|
|
96
98
|
readonly password?: string;
|
|
99
|
+
/**
|
|
100
|
+
* TLS on the wire (tedious `encrypt`). Unset = `@effect/sql-mssql`'s own
|
|
101
|
+
* default, which is **`false`** — it overrides tedious' `true`
|
|
102
|
+
* (`MssqlClient.js:54`), so an mssql connection is plaintext unless something
|
|
103
|
+
* asks otherwise.
|
|
104
|
+
*
|
|
105
|
+
* That "something" used to be nothing: `connectionFromConfig` never read
|
|
106
|
+
* `ConnectionConfig.ssl`, so `DB_URL=mssql://…?ssl=true` or `PG_SSL=require`
|
|
107
|
+
* connected in plaintext — the same silent downgrade the mysql dialect had.
|
|
108
|
+
* It is derived from `ssl` now, and an unsupported request throws.
|
|
109
|
+
*/
|
|
97
110
|
readonly encrypt?: boolean;
|
|
111
|
+
/**
|
|
112
|
+
* Skip verification of the server certificate (tedious
|
|
113
|
+
* `trustServerCertificate`). Only meaningful with `encrypt: true`, where it
|
|
114
|
+
* is what makes `sslmode=require` semantics — encrypt, don't authenticate the
|
|
115
|
+
* server — expressible on this driver.
|
|
116
|
+
*/
|
|
98
117
|
readonly trustServer?: boolean;
|
|
99
118
|
readonly maxConnections?: number;
|
|
119
|
+
/**
|
|
120
|
+
* Bound on ESTABLISHING a connection (ms) — `@effect/sql-mssql`'s
|
|
121
|
+
* `connectTimeout`, which is tedious' connect timeout AND the deadline on the
|
|
122
|
+
* boot `SELECT 1` probe (`MssqlClient.js:230`). Default
|
|
123
|
+
* {@link DEFAULT_ACQUIRE_TIMEOUT_MS}, `0` = the driver's own (5 s probe).
|
|
124
|
+
*
|
|
125
|
+
* As on mysql, this does NOT bound waiting for a BUSY pooled connection:
|
|
126
|
+
* `@effect/sql-mssql` pools through an Effect `Pool` whose `get` takes no
|
|
127
|
+
* timeout, and the client exposes no knob for it. Naming that gap is the
|
|
128
|
+
* point — the same reason `statementTimeoutMs` is left unwired here rather
|
|
129
|
+
* than mapped onto `connectTimeout`, which bounds a different phase.
|
|
130
|
+
*/
|
|
131
|
+
readonly acquireTimeoutMs?: number;
|
|
100
132
|
}
|
|
101
133
|
|
|
102
134
|
export declare const mssqlDialect: SqlDialect;
|
|
@@ -117,6 +149,10 @@ export declare class MssqlStore implements DataStore {
|
|
|
117
149
|
private readonly namespace;
|
|
118
150
|
private readonly emitter;
|
|
119
151
|
private inflightTxns;
|
|
152
|
+
/** PERF-23 — counts EVERY eager JSON-agg → walker degradation and logs a
|
|
153
|
+
* rate-limited line. Instance-scoped so a second store in one process cannot
|
|
154
|
+
* silence this one's first warning. */
|
|
155
|
+
private readonly reportEagerFallback;
|
|
120
156
|
private cdcHandle;
|
|
121
157
|
private cdcCheckpointTimer;
|
|
122
158
|
private cdcPendingVersion;
|
|
@@ -174,6 +210,18 @@ export declare class MssqlStore implements DataStore {
|
|
|
174
210
|
}): Promise<ReadonlyArray<T>>;
|
|
175
211
|
private runWithEager;
|
|
176
212
|
/* Excluded from this release type: getInternalRunWithEager */
|
|
213
|
+
/**
|
|
214
|
+
* Bracket a NON-transactional write: the attribution capture every public
|
|
215
|
+
* write already did, plus the ONE metrics funnel for this dialect's writes
|
|
216
|
+
* (`voltro_db_queries_total{op}`).
|
|
217
|
+
*
|
|
218
|
+
* Named to match postgres' / mysql's `localWrite`. Those two additionally
|
|
219
|
+
* hold the table's transport echoes for the write's duration; Change Tracking
|
|
220
|
+
* has no per-write NOTIFY echo to order against, so this one is the
|
|
221
|
+
* attribution + metrics half only. One name for the write funnel across four
|
|
222
|
+
* stores is what lets the parity test ask the question at all.
|
|
223
|
+
*/
|
|
224
|
+
private localWrite;
|
|
177
225
|
insert(t: string, r: Row): Promise<Readonly<Record<string, unknown>>>;
|
|
178
226
|
insertMany(t: string, rows: ReadonlyArray<Row>): Promise<readonly Readonly<Record<string, unknown>>[]>;
|
|
179
227
|
patchJson(t: string, pk: string, path: string, value: unknown): Promise<Readonly<Record<string, unknown>> | null>;
|
|
@@ -223,6 +271,16 @@ export declare class MssqlStore implements DataStore {
|
|
|
223
271
|
/* Excluded from this release type: getInternalExecuteUpsert */
|
|
224
272
|
/* Excluded from this release type: getInternalExecuteInsertIgnore */
|
|
225
273
|
transactional<T>(work: (tx: DataStore) => Promise<T>): Promise<T>;
|
|
274
|
+
/**
|
|
275
|
+
* The DIALECT half of the shared transaction bracket
|
|
276
|
+
* (`runStoreTransaction` in `@voltro/database`).
|
|
277
|
+
*
|
|
278
|
+
* mssql owns three things: the client's `withTransaction`, the runtime, and
|
|
279
|
+
* `isRetryableMssqlFailure` (deadlock victim, 1205). Retry, commit-defect
|
|
280
|
+
* promotion, attribution threading and exit settling are shared — see
|
|
281
|
+
* `transactionOutcome.ts` for why none of those may be re-decided here.
|
|
282
|
+
*/
|
|
283
|
+
private txnSpec;
|
|
226
284
|
onChange(listener: (event: ChangeEvent) => void): () => void;
|
|
227
285
|
/** 'fleet' under Change Tracking CDC (every replica gets the full
|
|
228
286
|
* stream); 'local' under inline emission. See DataStore.changeScope. */
|