Commit 612fe44
refactor(codegen+metadata): FR-016 generator-stack sweep — physicalName everywhere
Routes every codegen / runtime call site that resolves a source's physical
SQL name through MetaSource.physicalName instead of the legacy @table-only
slot accessor. With this in place, an entity declared with @kind: "view" +
@view: "v_x" (or any kind-aware alias) emits the correct physical name in
Drizzle / Kysely / view-projection / extract-view-spec output without
per-call-site special-casing.
Changes:
- packages/metadata/src/core/object/meta-object.ts — MetaObject.dbTable now
delegates to source.physicalName (still scoped to writable + primary so
CQRS read-side accessors don't get confused with the write target).
- packages/codegen-ts/src/projection/extract-view-spec.ts — viewName() reads
source.physicalName instead of source.tableName, so projection sources can
use @view (canonical) or legacy @table interchangeably.
- packages/metadata/test/meta/meta-object.test.ts — the "empty @table"
back-compat test was asserting pre-FR-016 behavior (undefined). Post-FR-016
the resolver falls through to step 4 (entity-name pluralize); the test
now exercises that path explicitly and asserts "users" for entity "User".
migrate-ts equivalents (expected-schema.ts, expected-views.ts, rename-heuristic.ts)
remain on the sister plan's Task A — this commit deliberately doesn't touch them.
Pre-existing extract-codegen test failures unrelated to this change.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>1 parent 5c9ab20 commit 612fe44
3 files changed
Lines changed: 27 additions & 8 deletions
File tree
- server/typescript/packages
- codegen-ts/src/projection
- metadata
- src/core/object
- test/meta
Lines changed: 11 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
50 | 53 | | |
51 | 54 | | |
52 | 55 | | |
53 | | - | |
54 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
55 | 63 | | |
56 | 64 | | |
57 | 65 | | |
| |||
Lines changed: 7 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
43 | 46 | | |
44 | 47 | | |
45 | 48 | | |
46 | 49 | | |
47 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
48 | 53 | | |
49 | 54 | | |
50 | 55 | | |
| |||
Lines changed: 9 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
108 | 112 | | |
109 | | - | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
110 | 116 | | |
111 | 117 | | |
112 | 118 | | |
113 | | - | |
| 119 | + | |
114 | 120 | | |
115 | 121 | | |
116 | 122 | | |
| |||
0 commit comments