Fundamentally I expect it to generate code that compiles, however, I am not sure if the right approach here is to figure out somehow that it should use BigDecimal during codegen or if it should alias BigDecimal as Decimal when only the one feature flag is enabled.
If both feature flags are enabled I think it would be appropriate to default to one or the other and leave it up to the user to manually change them as needed. I would lean towards defaulting to BigDecimal as it is not a default feature flag so having both active implies it is the preference. I don't have particularly strong feelings on this case since I think most people (myself for sure) will decide to use just one or the other exclusively, though, it is not improbable that someone will accidentally not disable the default feature flag.
Actual Behavior
Generated code that does not compile with the chosen feature flags.
Reproduces How Often
Reliably
Workarounds
For now I am just manually replacing all generated Decimal references with BigDecimal.
Reproducible Example
Non-trivial as it requires generating code from a live database.
Description
The auto-generated
Model
defaults toDecimal
which breaks whenwith-rust_decimal
is disabled andwith-bigdecimal
is enabled.Also the docs do not list
BigDecimal
as a valid numeric/decimal type. https://www.sea-ql.org/SeaORM/docs/generate-entity/entity-structure/#column-typeSteps to Reproduce
I have a postgres table defined with a migration
that works without issue but then when I generate an entity using the
sea-orm-cli
it generates an invalidModel
implementation ofExpected Behavior
Fundamentally I expect it to generate code that compiles, however, I am not sure if the right approach here is to figure out somehow that it should use
BigDecimal
during codegen or if it should aliasBigDecimal
asDecimal
when only the one feature flag is enabled.If both feature flags are enabled I think it would be appropriate to default to one or the other and leave it up to the user to manually change them as needed. I would lean towards defaulting to
BigDecimal
as it is not a default feature flag so having both active implies it is the preference. I don't have particularly strong feelings on this case since I think most people (myself for sure) will decide to use just one or the other exclusively, though, it is not improbable that someone will accidentally not disable the default feature flag.Actual Behavior
Generated code that does not compile with the chosen feature flags.
Reproduces How Often
Reliably
Workarounds
For now I am just manually replacing all generated
Decimal
references withBigDecimal
.Reproducible Example
Non-trivial as it requires generating code from a live database.
Versions
postgres 15