bigal 14.1.26 → 15.0.1

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 CHANGED
@@ -1,3 +1,20 @@
1
+ ## [15.0.1](https://github.com/bigalorm/bigal/compare/v15.0.0...v15.0.1) (2026-01-07)
2
+
3
+ # [15.0.0](https://github.com/bigalorm/bigal/compare/v14.1.26...v15.0.0) (2025-12-28)
4
+
5
+ - feat!: support pluggable PostgreSQL drivers ([7638343](https://github.com/bigalorm/bigal/commit/76383432acc8ee1bdf48a8c60a8e5fa10176bd69))
6
+
7
+ ### BREAKING CHANGES
8
+
9
+ - pg and postgres-pool are no longer bundled dependencies.
10
+ Users must now install their preferred PostgreSQL driver separately.
11
+
12
+ * Add PoolLike interface for driver-agnostic pool support
13
+ * Support pg, postgres-pool, @neondatabase/serverless, or any compatible driver
14
+ * Remove pg and @types/pg from dependencies
15
+ * Move postgres-pool to devDependencies
16
+ * Update README with driver installation options
17
+
1
18
  ## [14.1.26](https://github.com/bigalorm/bigal/compare/v14.1.25...v14.1.26) (2025-12-25)
2
19
 
3
20
  ## [14.1.25](https://github.com/bigalorm/bigal/compare/v14.1.24...v14.1.25) (2025-12-25)
package/README.md CHANGED
@@ -19,9 +19,79 @@ This ORM does not:
19
19
  ## Install
20
20
 
21
21
  ```sh
22
- npm install pg postgres-pool bigal
22
+ npm install bigal
23
23
  ```
24
24
 
25
+ You'll also need a PostgreSQL driver. Choose one of the following:
26
+
27
+ ```sh
28
+ # Option 1: postgres-pool (recommended)
29
+ npm install postgres-pool
30
+
31
+ # Option 2: node-postgres
32
+ npm install pg
33
+
34
+ # Option 3: Neon serverless
35
+ npm install @neondatabase/serverless
36
+ ```
37
+
38
+ ## Using Alternative PostgreSQL Drivers
39
+
40
+ BigAl is compatible with any PostgreSQL driver that implements the standard `pool.query()` method, including:
41
+
42
+ - [postgres-pool](https://www.npmjs.com/package/postgres-pool) (default)
43
+ - [pg](https://www.npmjs.com/package/pg) (node-postgres)
44
+ - [@neondatabase/serverless](https://www.npmjs.com/package/@neondatabase/serverless)
45
+
46
+ ### Using with Neon Serverless
47
+
48
+ ```ts
49
+ import { Pool } from '@neondatabase/serverless';
50
+ import { initialize, Repository } from 'bigal';
51
+ import { Product, Store } from './models';
52
+
53
+ const pool = new Pool({ connectionString: process.env.DATABASE_URL });
54
+
55
+ const repositoriesByName = initialize({
56
+ models: [Product, Store],
57
+ pool,
58
+ });
59
+ ```
60
+
61
+ ### Using with node-postgres (pg)
62
+
63
+ ```ts
64
+ import { Pool } from 'pg';
65
+ import { initialize, Repository } from 'bigal';
66
+ import { Product, Store } from './models';
67
+
68
+ const pool = new Pool({ connectionString: process.env.DATABASE_URL });
69
+
70
+ const repositoriesByName = initialize({
71
+ models: [Product, Store],
72
+ pool,
73
+ });
74
+ ```
75
+
76
+ ### Type Requirements
77
+
78
+ Any pool implementation must satisfy the `PoolLike` interface:
79
+
80
+ ```ts
81
+ import type { PoolLike, PoolQueryResult } from 'bigal';
82
+
83
+ interface PoolQueryResult<TRow extends Record<string, unknown>> {
84
+ rows: TRow[];
85
+ rowCount: number | null;
86
+ }
87
+
88
+ interface PoolLike {
89
+ query<TRow extends Record<string, unknown> = Record<string, unknown>>(text: string, values?: readonly unknown[]): Promise<PoolQueryResult<TRow>>;
90
+ }
91
+ ```
92
+
93
+ All standard PostgreSQL drivers (pg, postgres-pool, @neondatabase/serverless) satisfy this interface.
94
+
25
95
  ## Configuring
26
96
 
27
97
  ### Defining database models