@ultimat3/core 31.16.0 → 31.17.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ultimat3/core",
3
- "version": "31.16.0",
3
+ "version": "31.17.0",
4
4
  "description": "Ultimate's foundation: errors, context, env, config, clock, ids, logging, telemetry, lifecycle",
5
5
  "keywords": [
6
6
  "ultimate",
@@ -54,6 +54,6 @@
54
54
  "test": "bun test"
55
55
  },
56
56
  "dependencies": {
57
- "@ultimat3/schema": "31.16.0"
57
+ "@ultimat3/schema": "31.17.0"
58
58
  }
59
59
  }
@@ -2,7 +2,7 @@
2
2
  // at any depth and in any layer, is refused by path with the key it most likely meant. A key that
3
3
  // is merged and read by nothing is the switch with no wire, and a typo (`drian`) is the same defect.
4
4
 
5
- import type { JobsConfig } from './config';
5
+ import type { DatabaseConfig, JobsConfig } from './config';
6
6
  import type { AssetsRetainConfig } from './config-assets';
7
7
  import { BASE_FIX } from './config-fixes';
8
8
  import type { MailRetainMimeConfig } from './config-mail';
@@ -64,6 +64,7 @@ export const SECTION_KEYS: Readonly<Record<string, readonly string[]>> = Object.
64
64
  'pwa.screenshots[]': keysOf<PwaScreenshot>()(['src', 'sizes', 'type', 'formFactor', 'label']),
65
65
  'mail.retainMime': keysOf<MailRetainMimeConfig>()(['maxBytes']),
66
66
  'assets.retain': keysOf<AssetsRetainConfig>()(['disk', 'builds']),
67
+ database: keysOf<DatabaseConfig>()(['driver', 'ssl', 'rowSecurity', 'slowStatementMs']),
67
68
  jobs: keysOf<JobsConfig>()([
68
69
  'queues',
69
70
  'concurrency',
package/src/config.ts CHANGED
@@ -114,6 +114,11 @@ export interface DatabaseConfig {
114
114
  * (`X_DB_ROW_SECURITY_BYPASSED`). Off by default: a transaction per bare statement is not free.
115
115
  */
116
116
  readonly rowSecurity: boolean;
117
+ /**
118
+ * A statement at or over this many ms writes one `db.statement.slow` warn line in production.
119
+ * Unset is the boot's own 500 ms (`SLOW_STATEMENT_THRESHOLD_MS`); `0` is off.
120
+ */
121
+ readonly slowStatementMs?: number;
117
122
  }
118
123
 
119
124
  /**
@@ -307,6 +312,9 @@ function validate(config: AppConfig): void {
307
312
  oneOfIssue('database.driver', config.database.driver, DATABASE_DRIVERS),
308
313
  booleanIssue('database.ssl', config.database.ssl),
309
314
  booleanIssue('database.rowSecurity', config.database.rowSecurity),
315
+ config.database.slowStatementMs === undefined
316
+ ? undefined
317
+ : countIssue('database.slowStatementMs', config.database.slowStatementMs, 0),
310
318
  oneOfIssue('theme.defaultMode', config.theme.defaultMode, THEME_MODES),
311
319
  // `null` is the documented "no redirect"; a path that is said must be one a browser can follow.
312
320
  config.auth.signInPath === null