@voltro/database 0.22.1 → 0.24.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 +427 -0
- package/dist/{fileBased-CDnutVVk.js → frameworkLiveTables-BvPIm2cD.js} +174 -174
- package/dist/index.d.ts +40 -0
- package/dist/index.js +651 -651
- package/dist/sql.d.ts +114 -5
- package/dist/sql.js +981 -861
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1404,6 +1404,31 @@ export declare interface ConnectionConfig {
|
|
|
1404
1404
|
*/
|
|
1405
1405
|
readonly ssl?: boolean;
|
|
1406
1406
|
readonly maxConnections?: number;
|
|
1407
|
+
/**
|
|
1408
|
+
* Per-statement timeout in ms — a runaway query (missing index, cartesian
|
|
1409
|
+
* join) is aborted instead of holding a pooled connection forever, which under
|
|
1410
|
+
* load exhausts the pool and stalls the whole app. Applied at the CONNECTION
|
|
1411
|
+
* level so every query is bounded (no per-call opt-in). Env `DB_STATEMENT_TIMEOUT_MS`.
|
|
1412
|
+
* Runtime-path only — the migration path (`voltro db apply`) deliberately does
|
|
1413
|
+
* NOT read this, so a long backfill / index build is never cancelled by the app
|
|
1414
|
+
* query ceiling.
|
|
1415
|
+
*
|
|
1416
|
+
* **Wired for postgres only** (the default dialect), enforced server-side via
|
|
1417
|
+
* node-postgres' `statement_timeout` pool option — a runaway query is cancelled
|
|
1418
|
+
* with SQLSTATE 57014, not merely disconnected. Every OTHER dialect currently
|
|
1419
|
+
* ACCEPTS the field but IGNORES it, and the honest reasons differ:
|
|
1420
|
+
* - **mssql** — `@effect/sql-mssql` exposes only `connectTimeout` (connection
|
|
1421
|
+
* establishment), not tedious's per-request `requestTimeout`; mapping this
|
|
1422
|
+
* onto `connectTimeout` would bound the wrong phase, so it is left unwired
|
|
1423
|
+
* rather than wrong.
|
|
1424
|
+
* - **mysql/mariadb** — the server's `max_execution_time` bounds SELECTs only
|
|
1425
|
+
* (writes run unbounded), so a connection-level setting would be a partial,
|
|
1426
|
+
* misleading guarantee; not wired in V1.
|
|
1427
|
+
* - **sqlite** — in-process, one connection, no pool to exhaust; nothing to
|
|
1428
|
+
* protect.
|
|
1429
|
+
* Unset (or any non-postgres dialect) = no timeout — behaviour is unchanged.
|
|
1430
|
+
*/
|
|
1431
|
+
readonly statementTimeoutMs?: number;
|
|
1407
1432
|
/**
|
|
1408
1433
|
* Postgres only: the schema the app's tables live in, pinned as the
|
|
1409
1434
|
* connection `search_path` (env `DB_SCHEMA`). When set, EVERY pooled
|
|
@@ -2308,6 +2333,17 @@ declare interface FormatIssueOptions {
|
|
|
2308
2333
|
readonly indent?: string;
|
|
2309
2334
|
}
|
|
2310
2335
|
|
|
2336
|
+
/**
|
|
2337
|
+
* Live tables the framework's own runtime creates under a name that does NOT
|
|
2338
|
+
* start with a reserved prefix, so the prefix rule below cannot recognise them.
|
|
2339
|
+
*
|
|
2340
|
+
* Public because consumers need to tell "a table the app declares" from "one the
|
|
2341
|
+
* framework or a plugin brought" — `plugin-versioning` reads it to decide its
|
|
2342
|
+
* default watch set. One copy of that rule on purpose: a second copy of it is
|
|
2343
|
+
* how a per-dialect difference in what `voltro dev` does got shipped once.
|
|
2344
|
+
*/
|
|
2345
|
+
export declare const FRAMEWORK_LIVE_TABLES: ReadonlySet<string>;
|
|
2346
|
+
|
|
2311
2347
|
/** All framework tables as an array — useful for bootstrap DDL emission. */
|
|
2312
2348
|
export declare const frameworkTables: readonly [TableLike, TableLike, TableLike];
|
|
2313
2349
|
|
|
@@ -2686,6 +2722,10 @@ export declare const isFieldDecryptionError: (e: unknown) => e is FieldDecryptio
|
|
|
2686
2722
|
/** Type-guard for the discovery walker. */
|
|
2687
2723
|
export declare const isFileMigration: (value: unknown) => value is FileMigration;
|
|
2688
2724
|
|
|
2725
|
+
/** True when `name` is a live table the framework / its runtime engines create
|
|
2726
|
+
* but no user schema declares — never plan a drop for it. */
|
|
2727
|
+
export declare const isFrameworkOwnedLiveTable: (name: string) => boolean;
|
|
2728
|
+
|
|
2689
2729
|
export declare const isMigrationDefinition: (value: unknown) => value is MigrationDefinition;
|
|
2690
2730
|
|
|
2691
2731
|
/**
|