@ultimat3/db 27.13.0 → 27.13.2

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/db",
3
- "version": "27.13.0",
3
+ "version": "27.13.2",
4
4
  "description": "Postgres access, transactions, migrations and drift detection",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -33,7 +33,7 @@
33
33
  "test": "bun test"
34
34
  },
35
35
  "dependencies": {
36
- "@ultimat3/core": "27.13.0"
36
+ "@ultimat3/core": "27.13.2"
37
37
  },
38
38
  "peerDependencies": {
39
39
  "@electric-sql/pglite": ">=0.5.0"
package/src/index.ts CHANGED
@@ -172,7 +172,7 @@ export type { LinkedExtensions, PgliteExtensionLoader } from './pglite-extension
172
172
  export { linkPgliteExtensions } from './pglite-extensions';
173
173
  export { pgliteVersion } from './pglite-snapshot';
174
174
  export type { PoolProfile } from './pool-profile';
175
- export { POOL_MAX_ENV, POOL_PROFILES, poolProfileFor } from './pool-profile';
175
+ export { POOL_MAX_ENV, POOL_PROFILES, poolMaxFromEnv, poolProfileFor } from './pool-profile';
176
176
  export type { ReadOnlyQueryOptions, ReadOnlyQueryResult } from './readonly-query';
177
177
  export { READONLY_TIMEOUT_MS, readOnlyQuery } from './readonly-query';
178
178
  export type { ReadOnlyRoleOptions } from './readonly-role';
@@ -114,8 +114,10 @@ export const POOL_MAX_ENV = 'DATABASE_POOL_MAX';
114
114
  * rather than falling back: a fleet that ignored the number it was given is the failure the
115
115
  * variable exists to prevent, and it would only be found in `pg_stat_activity` at 3am.
116
116
  */
117
- export function poolMaxFromEnv(): Partial<PoolProfile> {
118
- const raw = process.env[POOL_MAX_ENV];
117
+ export function poolMaxFromEnv(
118
+ env: Readonly<Record<string, string | undefined>> = process.env,
119
+ ): Partial<PoolProfile> {
120
+ const raw = env[POOL_MAX_ENV];
119
121
  if (raw === undefined || raw.trim() === '') return {};
120
122
  const max = Number(raw);
121
123
  if (!Number.isSafeInteger(max) || max < 1) throw poolMaxInvalid(raw);