Skip to content

Commit 70fd2dd

Browse files
dmealingclaude
andcommitted
docs: CHANGELOG breaking entry + README recipe pointer (FR2 Phase E)
CHANGELOG.md [Unreleased] gains a Changed-section BREAKING entry describing the param-passing migration (findUserById(id) -> findUserById(db, id)). codegen-ts/README.md gains a "Consumer wiring" section pointing at the new wiring-generated-queries.md recipe and ADR-0008. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent c3e4d74 commit 70fd2dd

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,18 @@ this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
3030
- `meta verify` log line format adds `(<subtype>)` after the template name
3131
(e.g., `[npcTurn] (prompt) ERR_*`). A pre-FR6 log scraper that matched
3232
on the bare `[name]` prefix needs to update its regex.
33+
- **BREAKING (codegen-ts):** Generated `<Entity>.queries.ts` CRUD helpers now
34+
accept a Drizzle `db` instance as the **first parameter** of every function
35+
(`findUserById(db, id)`, `listUsers(db, opts)`, `createUser(db, data)`,
36+
`updateUser(db, id, data)`, `deleteUserById(db, id)`). The module-level
37+
`import { db } from "<dbImport>"` line is no longer emitted; instead, every
38+
file declares a dialect-correct `type Db = ...` alias at the top. Migration:
39+
bump, regen, search-and-replace call sites — see the new
40+
[wiring-generated-queries.md](docs/recipes/wiring-generated-queries.md)
41+
recipe for the full guide. Background: [ADR-0008](spec/decisions/ADR-0008-parameter-passing-generated-repo-helpers.md).
42+
Enables Cloudflare Workers / edge consumers to drop their typecheck stubs;
43+
enables multi-tenant servers + test-isolated `db` setups. `routesFile()` is
44+
unchanged.
3345

3446
See [ADR-0010](spec/decisions/ADR-0010-template-output-parser-codegen.md)
3547
for the cross-port design.

server/typescript/packages/codegen-ts/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,14 @@ codegen-ts overwrites files with the header but refuses to touch files
5757
without it. Hand-customizations live in sibling `<Entity>.extra.ts` files
5858
(for custom queries, derived-column indexes, etc. that metadata can't express).
5959

60+
### Consumer wiring
61+
62+
Generated query helpers accept a Drizzle `db` instance as their first
63+
parameter. See [wiring-generated-queries.md](../../../../docs/recipes/wiring-generated-queries.md)
64+
for per-dialect setup, edge (Workers / D1) examples, and a 0.6.0 → 0.7.0
65+
migration guide. The cross-language design decision is in
66+
[ADR-0008](../../../../spec/decisions/ADR-0008-parameter-passing-generated-repo-helpers.md).
67+
6068
## Output targets
6169

6270
Each generator can be routed to its own output directory via a named **target**

0 commit comments

Comments
 (0)