@relq/orm 0.1.2 → 0.1.3

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.
@@ -3,14 +3,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isPoolingEnabled = isPoolingEnabled;
4
4
  exports.toPoolConfig = toPoolConfig;
5
5
  exports.isAwsDsqlConfig = isAwsDsqlConfig;
6
- const pool_defaults_1 = require("../../orm/utils/pool-defaults.cjs");
6
+ function mergeWithDefaults(userConfig) {
7
+ return {
8
+ min: userConfig?.min ?? 0,
9
+ max: userConfig?.max ?? 10,
10
+ idleTimeoutMillis: userConfig?.idleTimeoutMillis ?? 30000,
11
+ connectionTimeoutMillis: userConfig?.connectionTimeoutMillis ?? 10000,
12
+ };
13
+ }
7
14
  function isPoolingEnabled(config) {
8
15
  return config.pooling !== false;
9
16
  }
10
17
  function toPoolConfig(config) {
11
18
  const smartDefaults = config.disableSmartDefaults
12
19
  ? { min: 0, max: 10, idleTimeoutMillis: 30000, connectionTimeoutMillis: 0 }
13
- : (0, pool_defaults_1.mergeWithDefaults)(config.pool);
20
+ : mergeWithDefaults(config.pool);
14
21
  const isAws = !!config.aws;
15
22
  const host = isAws ? config.aws.hostname : (config.host || 'localhost');
16
23
  const port = config.aws?.port ?? config.port ?? 5432;
@@ -1,4 +1,11 @@
1
- import { mergeWithDefaults } from "../../orm/utils/pool-defaults.js";
1
+ function mergeWithDefaults(userConfig) {
2
+ return {
3
+ min: userConfig?.min ?? 0,
4
+ max: userConfig?.max ?? 10,
5
+ idleTimeoutMillis: userConfig?.idleTimeoutMillis ?? 30000,
6
+ connectionTimeoutMillis: userConfig?.connectionTimeoutMillis ?? 10000,
7
+ };
8
+ }
2
9
  export function isPoolingEnabled(config) {
3
10
  return config.pooling !== false;
4
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@relq/orm",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "The runtime engine for Relq — type-safe PostgreSQL ORM for TypeScript",
5
5
  "author": "Olajide Mathew O. <olajide.mathew@yuniq.solutions>",
6
6
  "license": "MIT",