bigal 16.0.0-beta.3 → 16.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/.devcontainer/devcontainer.json +1 -1
- package/.vite-hooks/pre-commit +1 -0
- package/CHANGELOG.md +31 -11
- package/CLAUDE.md +4 -4
- package/README.md +29 -43
- package/dist/index.cjs +3274 -4277
- package/dist/index.d.cts +1511 -1425
- package/dist/index.d.mts +1511 -1425
- package/dist/index.mjs +3265 -4244
- package/docs/.vitepress/config.ts +0 -1
- package/docs/advanced/bigal-vs-raw-sql.md +23 -23
- package/docs/advanced/known-issues.md +26 -21
- package/docs/getting-started.md +35 -29
- package/docs/guide/crud-operations.md +42 -61
- package/docs/guide/models.md +97 -396
- package/docs/guide/querying.md +82 -98
- package/docs/guide/relationships.md +125 -90
- package/docs/guide/subqueries-and-joins.md +39 -32
- package/docs/guide/views.md +51 -79
- package/docs/index.md +31 -27
- package/docs/package.json +3 -2
- package/docs/pnpm-lock.yaml +2338 -0
- package/docs/pnpm-workspace.yaml +3 -0
- package/docs/reference/api.md +86 -383
- package/docs/reference/configuration.md +26 -113
- package/package.json +58 -77
- package/pnpm-workspace.yaml +14 -0
- package/release.config.mjs +1 -1
- package/skills/using-bigal/SKILL.md +213 -276
- package/vite.config.ts +83 -0
- package/.husky/pre-commit +0 -4
- package/.oxfmtrc.json +0 -38
- package/.oxlintrc.json +0 -219
- package/dist/index.d.ts +0 -1527
- package/docs/guide/migration-v16.md +0 -594
- package/docs/package-lock.json +0 -3753
- package/scripts/migrate-v16.ts +0 -578
- package/skills/upgrade-v16/SKILL.md +0 -296
|
@@ -0,0 +1 @@
|
|
|
1
|
+
vp staged
|
package/CHANGELOG.md
CHANGED
|
@@ -1,24 +1,44 @@
|
|
|
1
|
-
## [16.0.
|
|
1
|
+
## [16.0.1](https://github.com/bigalorm/bigal/compare/v16.0.0...v16.0.1) (2026-07-13)
|
|
2
2
|
|
|
3
|
-
###
|
|
3
|
+
### Bug Fixes
|
|
4
4
|
|
|
5
|
-
-
|
|
5
|
+
- **deps:** pin conventional-changelog-conventionalcommits to 9.x ([#474](https://github.com/bigalorm/bigal/issues/474)) ([05ac685](https://github.com/bigalorm/bigal/commit/05ac6852e93b5d929b198fe62839c2f2bffb096f))
|
|
6
6
|
|
|
7
|
-
## [16.0.0
|
|
7
|
+
## [16.0.0](https://github.com/bigalorm/bigal/compare/v15.12.0...v16.0.0) (2026-07-13)
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
## [15.12.0](https://github.com/bigalorm/bigal/compare/v15.11.12...v15.12.0) (2026-07-12)
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
## [15.11.12](https://github.com/bigalorm/bigal/compare/v15.11.11...v15.11.12) (2026-07-11)
|
|
12
12
|
|
|
13
|
-
## [
|
|
13
|
+
## [15.11.11](https://github.com/bigalorm/bigal/compare/v15.11.10...v15.11.11) (2026-07-11)
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
## [15.11.10](https://github.com/bigalorm/bigal/compare/v15.11.9...v15.11.10) (2026-06-09)
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
### Bug Fixes
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
- qualify base-table columns when a query has a join ([#435](https://github.com/bigalorm/bigal/issues/435)) ([667e1f3](https://github.com/bigalorm/bigal/commit/667e1f3d427f73713e30bb7bf18f5f7e61acd206))
|
|
20
|
+
|
|
21
|
+
## [15.11.9](https://github.com/bigalorm/bigal/compare/v15.11.8...v15.11.9) (2026-05-19)
|
|
22
|
+
|
|
23
|
+
## [15.11.8](https://github.com/bigalorm/bigal/compare/v15.11.7...v15.11.8) (2026-05-19)
|
|
24
|
+
|
|
25
|
+
### Bug Fixes
|
|
26
|
+
|
|
27
|
+
- prevent propertyName leak across where-clause iteration ([#403](https://github.com/bigalorm/bigal/issues/403)) ([0454e84](https://github.com/bigalorm/bigal/commit/0454e84d4c6fdf46fc14bdcf57ab409619ea8a03)), closes [#393](https://github.com/bigalorm/bigal/issues/393)
|
|
28
|
+
|
|
29
|
+
## [15.11.7](https://github.com/bigalorm/bigal/compare/v15.11.6...v15.11.7) (2026-04-26)
|
|
30
|
+
|
|
31
|
+
### Bug Fixes
|
|
32
|
+
|
|
33
|
+
- Return Pick<QueryResult<T>> from chained .select() ([#390](https://github.com/bigalorm/bigal/issues/390)) ([89780a4](https://github.com/bigalorm/bigal/commit/89780a4068c312fcf59b8598eb35792e3b498918))
|
|
34
|
+
|
|
35
|
+
## [15.11.6](https://github.com/bigalorm/bigal/compare/v15.11.5...v15.11.6) (2026-04-07)
|
|
36
|
+
|
|
37
|
+
### Bug Fixes
|
|
38
|
+
|
|
39
|
+
- Accept readonly arrays for column enum values ([4843e01](https://github.com/bigalorm/bigal/commit/4843e0117eedae2d0b601d9148ff2a885fad5f27))
|
|
20
40
|
|
|
21
|
-
|
|
41
|
+
## [15.11.5](https://github.com/bigalorm/bigal/compare/v15.11.4...v15.11.5) (2026-03-23)
|
|
22
42
|
|
|
23
43
|
## [15.11.4](https://github.com/bigalorm/bigal/compare/v15.11.3...v15.11.4) (2026-03-12)
|
|
24
44
|
|
package/CLAUDE.md
CHANGED
|
@@ -14,10 +14,10 @@ BigAl is a type-safe PostgreSQL ORM for Node.js/TypeScript. It uses a fluent bui
|
|
|
14
14
|
## Build and Test Commands
|
|
15
15
|
|
|
16
16
|
```bash
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
pnpm run build # Build the project using vp pack (Vite+)
|
|
18
|
+
pnpm test # Type-check and run all tests with Vitest
|
|
19
|
+
pnpm run lint # Run vp fmt, vp lint, and markdownlint
|
|
20
|
+
pnpm run check:types # Type-check without emitting files (tsc --noEmit --skipLibCheck)
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
## Code Style Guidelines
|
package/README.md
CHANGED
|
@@ -4,10 +4,9 @@
|
|
|
4
4
|
[](https://nodejs.org)
|
|
5
5
|
[](https://snyk.io/test/npm/bigal)
|
|
6
6
|
|
|
7
|
-
A PostgreSQL-optimized, type-safe TypeScript ORM for Node.js. BigAl uses a fluent builder
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
DISTINCT ON, subquery joins, ON CONFLICT upserts, and pgvector.
|
|
7
|
+
A PostgreSQL-optimized, type-safe TypeScript ORM for Node.js. BigAl uses a fluent builder pattern for queries,
|
|
8
|
+
decorator-based models, and immutable query state. Built exclusively for Postgres — queries are tuned for
|
|
9
|
+
Postgres performance with native support for JSONB, DISTINCT ON, subquery joins, ON CONFLICT upserts, and pgvector.
|
|
11
10
|
|
|
12
11
|
## Install
|
|
13
12
|
|
|
@@ -28,62 +27,49 @@ npm install pg
|
|
|
28
27
|
npm install @neondatabase/serverless
|
|
29
28
|
```
|
|
30
29
|
|
|
31
|
-
Requires Node.js >= 22.
|
|
32
|
-
|
|
33
30
|
## Quick Start
|
|
34
31
|
|
|
35
32
|
```ts
|
|
36
|
-
import {
|
|
37
|
-
import type { Repository } from 'bigal';
|
|
33
|
+
import { column, primaryColumn, table, Entity, initialize, Repository } from 'bigal';
|
|
38
34
|
import { Pool } from 'postgres-pool';
|
|
39
35
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
id
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
id: serial().primaryKey(),
|
|
53
|
-
name: text(),
|
|
54
|
-
products: hasMany('Product').via('store'),
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
// Initialize with typed destructuring -- no type assertions needed
|
|
36
|
+
@table({ name: 'products' })
|
|
37
|
+
class Product extends Entity {
|
|
38
|
+
@primaryColumn({ type: 'integer' })
|
|
39
|
+
public id!: number;
|
|
40
|
+
|
|
41
|
+
@column({ type: 'string', required: true })
|
|
42
|
+
public name!: string;
|
|
43
|
+
|
|
44
|
+
@column({ type: 'integer', required: true, name: 'price_cents' })
|
|
45
|
+
public priceCents!: number;
|
|
46
|
+
}
|
|
47
|
+
|
|
58
48
|
const pool = new Pool('postgres://localhost/mydb');
|
|
59
|
-
const { Product,
|
|
60
|
-
|
|
61
|
-
models: { Product, Store },
|
|
62
|
-
});
|
|
49
|
+
const repos = initialize({ models: [Product], pool });
|
|
50
|
+
const productRepository = repos.Product as Repository<Product>;
|
|
63
51
|
|
|
64
|
-
// Fluent queries
|
|
65
|
-
const products = await
|
|
52
|
+
// Fluent queries — just await the chain
|
|
53
|
+
const products = await productRepository
|
|
54
|
+
.find()
|
|
66
55
|
.where({ priceCents: { '>=': 1000 }, name: { contains: 'widget' } })
|
|
67
56
|
.sort('name asc')
|
|
68
57
|
.limit(10);
|
|
69
58
|
|
|
70
59
|
// Upserts with ON CONFLICT
|
|
71
|
-
await
|
|
72
|
-
|
|
73
|
-
// Inspect generated SQL without executing
|
|
74
|
-
const { sql, params } = Product.find().where({ name: 'Widget' }).toSQL();
|
|
60
|
+
await productRepository.create({ name: 'Widget', sku: 'WDG-001', priceCents: 999 }, { onConflict: { action: 'merge', targets: ['sku'], merge: ['priceCents'] } });
|
|
75
61
|
```
|
|
76
62
|
|
|
77
63
|
## Documentation
|
|
78
64
|
|
|
79
65
|
Full documentation is available at **[bigalorm.github.io/bigal](https://bigalorm.github.io/bigal/)**.
|
|
80
66
|
|
|
81
|
-
- [Getting Started](https://bigalorm.github.io/bigal/getting-started)
|
|
82
|
-
- [Models](https://bigalorm.github.io/bigal/guide/models)
|
|
83
|
-
- [Querying](https://bigalorm.github.io/bigal/guide/querying)
|
|
84
|
-
- [CRUD Operations](https://bigalorm.github.io/bigal/guide/crud-operations)
|
|
85
|
-
- [Subqueries & Joins](https://bigalorm.github.io/bigal/guide/subqueries-and-joins)
|
|
86
|
-
- [API Reference](https://bigalorm.github.io/bigal/reference/api)
|
|
67
|
+
- [Getting Started](https://bigalorm.github.io/bigal/getting-started) — install, first model, first query
|
|
68
|
+
- [Models](https://bigalorm.github.io/bigal/guide/models) — decorators, column options, relationships
|
|
69
|
+
- [Querying](https://bigalorm.github.io/bigal/guide/querying) — operators, pagination, JSONB, DISTINCT ON
|
|
70
|
+
- [CRUD Operations](https://bigalorm.github.io/bigal/guide/crud-operations) — create, update, destroy, upserts
|
|
71
|
+
- [Subqueries & Joins](https://bigalorm.github.io/bigal/guide/subqueries-and-joins) — subquery builder, aggregates
|
|
72
|
+
- [API Reference](https://bigalorm.github.io/bigal/reference/api) — all exports and method signatures
|
|
87
73
|
|
|
88
74
|
## Machine-Readable Documentation
|
|
89
75
|
|
|
@@ -105,7 +91,7 @@ npx skills add bigalorm/bigal
|
|
|
105
91
|
## Compatibility
|
|
106
92
|
|
|
107
93
|
- [PostgreSQL](http://www.postgresql.org/) 14 or above
|
|
108
|
-
- Node.js 22 or above
|
|
94
|
+
- Node.js 22.11.0 or above
|
|
109
95
|
|
|
110
96
|
## License
|
|
111
97
|
|