Skip to content

fix(codegen): emit uuid import for oxide format - #24

Merged
Mattt (aevv) merged 2 commits into
oxide-codegenfrom
mattt/emit-uuid-import-in-oxide-codegen
Aug 24, 2026
Merged

fix(codegen): emit uuid import for oxide format#24
Mattt (aevv) merged 2 commits into
oxide-codegenfrom
mattt/emit-uuid-import-in-oxide-codegen

Conversation

@aevv

@aevv Mattt (aevv) commented Aug 23, 2026

Copy link
Copy Markdown

The oxide format is generated with --with-prelude=none, so nothing re-exports Uuid the way sea_orm::entity::prelude does. write_rs_type names it by bare identifier, and gen_imports only ever emitted serde and active-enum imports — so any table with a native uuid column generated a file that could not compile.

This currently breaks main in common-specs: the card_fingerprints and card_fingerprint_hierarchy tables added in #193/#194 use t.uuid(...)

Emits use uuid::Uuid; when the entity has a uuid column (including uuid[]), following the existing gen_import_active_enum pattern, so it stays scoped to the oxide writer and does not change upstream output.

Verified against a local Postgres with the full common-specs schema

Also passes the missing rename_active_enums argument at the six impl_active_enum test call sites, which have not compiled since --rename-variant-name was added.

🤖 Generated with Claude Code

The oxide format is generated with --with-prelude=none, so nothing
re-exports Uuid the way sea_orm::entity::prelude does. write_rs_type
names it by bare identifier, and gen_imports only ever emitted serde
and active-enum imports, so any table with a native uuid column
produced a file that could not compile.

Emit `use uuid::Uuid;` when the entity has a uuid column, following
gen_import_active_enum. Decimal, IpNetwork and PgVector are named the
same way and will need the same treatment when a column first uses them.

Also pass the missing rename_active_enums argument at the six
impl_active_enum test call sites, which have not compiled since the
--rename-variant-name flag was added.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@aevv
Mattt (aevv) marked this pull request as ready for review August 24, 2026 06:44
@aevv
Mattt (aevv) merged commit 8513c48 into oxide-codegen Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants