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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bigal",
3
3
  "features": {
4
- "ghcr.io/devcontainers/features/node:1": {
4
+ "ghcr.io/devcontainers/features/node:2": {
5
5
  "version": "lts"
6
6
  }
7
7
  },
@@ -0,0 +1 @@
1
+ vp staged
package/CHANGELOG.md CHANGED
@@ -1,24 +1,44 @@
1
- ## [16.0.0-beta.3](https://github.com/bigalorm/bigal/compare/v16.0.0-beta.2...v16.0.0-beta.3) (2026-04-08)
1
+ ## [16.0.1](https://github.com/bigalorm/bigal/compare/v16.0.0...v16.0.1) (2026-07-13)
2
2
 
3
- ### Features
3
+ ### Bug Fixes
4
4
 
5
- - Readonly enum arrays, JSONB string operators, codemod improvements, and table() export ([81629fa](https://github.com/bigalorm/bigal/commit/81629fa9dea7d56b223c477a139ca46be1016f16))
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-beta.2](https://github.com/bigalorm/bigal/compare/v16.0.0-beta.1...v16.0.0-beta.2) (2026-03-24)
7
+ ## [16.0.0](https://github.com/bigalorm/bigal/compare/v15.12.0...v16.0.0) (2026-07-13)
8
8
 
9
- ### Features
9
+ ## [15.12.0](https://github.com/bigalorm/bigal/compare/v15.11.12...v15.12.0) (2026-07-12)
10
10
 
11
- - Type-safe populate, EntityOrId, and model registry ([1d68830](https://github.com/bigalorm/bigal/commit/1d688306e1574ae4f3275700c1325b7410daadf3))
11
+ ## [15.11.12](https://github.com/bigalorm/bigal/compare/v15.11.11...v15.11.12) (2026-07-11)
12
12
 
13
- ## [16.0.0-beta.1](https://github.com/bigalorm/bigal/compare/v15.11.4...v16.0.0-beta.1) (2026-03-23)
13
+ ## [15.11.11](https://github.com/bigalorm/bigal/compare/v15.11.10...v15.11.11) (2026-07-11)
14
14
 
15
- ### BREAKING CHANGES
15
+ ## [15.11.10](https://github.com/bigalorm/bigal/compare/v15.11.9...v15.11.10) (2026-06-09)
16
16
 
17
- - Function-based schema API
17
+ ### Bug Fixes
18
18
 
19
- ### Features
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
- - Function-based schema API ([5b67b83](https://github.com/bigalorm/bigal/commit/5b67b83c29cfe7b53b725415c0eeff175445ffac))
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
- npm run build # Build the project using unbuild
18
- npm test # Type-check and run all tests with Vitest
19
- npm run lint # Run oxlint, oxfmt, and markdownlint
20
- npm run check:types # Type-check without emitting files (tsgo --noEmit --skipLibCheck)
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
  [![node version](https://img.shields.io/node/v/bigal.svg?style=flat)](https://nodejs.org)
5
5
  [![Known Vulnerabilities](https://snyk.io/test/npm/bigal/badge.svg)](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
- pattern for queries, function-based schema definitions with PostgreSQL-native column builders,
9
- and immutable query state. Built exclusively for Postgres with native support for JSONB,
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 { initialize, defineTable as table, serial, text, integer, belongsTo, hasMany, createdAt, updatedAt } from 'bigal';
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
- // Define models with PostgreSQL-native column builders
41
- // Column names auto-derive from property keys (priceCents -> price_cents)
42
- const Product = table('products', {
43
- id: serial().primaryKey(),
44
- name: text().notNull(),
45
- priceCents: integer().notNull(),
46
- store: belongsTo('Store'),
47
- createdAt: createdAt(),
48
- updatedAt: updatedAt(),
49
- });
50
-
51
- const Store = table('stores', {
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, Store } = initialize({
60
- pool,
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 -- just await the chain
65
- const products = await Product.find()
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 Product.create({ name: 'Widget', priceCents: 999, store: 1 }, { onConflict: { action: 'merge', targets: ['name'], merge: ['priceCents'] } });
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) -- install, first model, first query
82
- - [Models](https://bigalorm.github.io/bigal/guide/models) -- table definitions, column types, relationships
83
- - [Querying](https://bigalorm.github.io/bigal/guide/querying) -- operators, pagination, JSONB, DISTINCT ON
84
- - [CRUD Operations](https://bigalorm.github.io/bigal/guide/crud-operations) -- create, update, destroy, upserts
85
- - [Subqueries & Joins](https://bigalorm.github.io/bigal/guide/subqueries-and-joins) -- subquery builder, aggregates
86
- - [API Reference](https://bigalorm.github.io/bigal/reference/api) -- all exports and method signatures
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