Skip to content

Regen demo schema relations - #96

Merged
ryanrasti merged 1 commit into
mainfrom
regen-demo-schema-relations
Aug 3, 2026
Merged

Regen demo schema relations#96
ryanrasti merged 1 commit into
mainfrom
regen-demo-schema-relations

Conversation

@ryanrasti

Copy link
Copy Markdown
Owner

No description provided.

Ran `npm run migrate && tg generate` against the demo DDL — these files
hadn't been regenerated since Relation.belongsTo/.has landed, so the
playground was showing older output than `tg generate` produces today
(and than the README and examples/basic already show).

Two changes fall out of the regen:
  - relations collapse to Relation.has / Relation.belongsTo
  - columns lose the type-argument form: (Int8<1>).column() -> Int8.column()

The `Relation` import is added by hand. `updateBlock` byte-preserves
everything before @generated-start (deliberately — it protects
hand-added imports like Connection in orders.ts), while
buildImportLines only runs from emitNewFile. So an existing file gains
Relation.* call sites without ever gaining the import, and codegen
output doesn't compile until the import is added. Left as-is here; the
generator needs a separate fix that merges managed symbols into the
existing typegres specifier.

Verified: astro check 0 errors, site vitest 17/17.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@ryanrasti
ryanrasti merged commit 098e59a into main Aug 3, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant