fix(codegen): emit uuid import for oxide format - #24
Merged
Mattt (aevv) merged 2 commits intoAug 24, 2026
Conversation
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>
Mattt (aevv)
marked this pull request as ready for review
August 24, 2026 06:44
Agni (a4n1)
approved these changes
Aug 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The oxide format is generated with
--with-prelude=none, so nothing re-exportsUuidthe waysea_orm::entity::preludedoes.write_rs_typenames it by bare identifier, andgen_importsonly ever emitted serde and active-enum imports — so any table with a nativeuuidcolumn generated a file that could not compile.This currently breaks
mainincommon-specs: thecard_fingerprintsandcard_fingerprint_hierarchytables added in #193/#194 uset.uuid(...)Emits
use uuid::Uuid;when the entity has a uuid column (includinguuid[]), following the existinggen_import_active_enumpattern, so it stays scoped to the oxide writer and does not change upstream output.Verified against a local Postgres with the full
common-specsschemaAlso passes the missing
rename_active_enumsargument at the siximpl_active_enumtest call sites, which have not compiled since--rename-variant-namewas added.🤖 Generated with Claude Code