Conversation
…a tailored `EnumIter` provided
| serde = { version = "1.0", features = ["derive"] } | ||
|
|
||
| [features] | ||
| default = ["derive"] |
There was a problem hiding this comment.
Why do we need a feature here? I think we always want to enable this right?
There was a problem hiding this comment.
Backward compatibility. Not a must, I just think it's better to ship with derive by default like it used to be.
There was a problem hiding this comment.
We have two features in sea-orm-macros
derive- provide all derive macros of SeaORM, e.g.DeriveEntityModelstrum- provide theEnumIterderive macros
I split the sea-orm-macros in half because one can opt-out the derive feature in SeaORM by specifying sea-orm = { version = "*", default-features = false }. Where the sea-orm-macros is a optional dependency. But now, the strum reside in it, making it a "compulsory" dependency. Instead, we turn on / off the derive feature as needed.
In contrast, we ALWAYS want the strum feature to be enabled.
Hence,
- sea-orm-macros = { version = "0.11.0", path = "sea-orm-macros", default-features = false, optional = true }
+ sea-orm-macros = { version = "0.11.0", path = "sea-orm-macros", default-features = false, features = ["strum"] }
[features]
- macros = ["sea-orm-macros", "sea-query/derive"]
+ macros = ["sea-orm-macros/derive", "sea-query/derive"]There was a problem hiding this comment.
Umm. This sounds complicated. Well but let it be for now.
| default = ["derive"] | ||
| postgres-array = [] | ||
| derive = ["bae"] | ||
| strum = [] |
There was a problem hiding this comment.
Same, I think we can just ship it by default
There was a problem hiding this comment.
For this, dependency are conditionally enabled when a feature is being enabled.
This should be fine. If we decided to keep derive and strum as it's now.
* Optional Field SeaQL/sea-orm#1513 * .gitignore SeaQL/sea-orm#1334 * migration table custom name SeaQL/sea-orm#1511 * OR condition relation SeaQL/sea-orm#1433 * DerivePartialModel SeaQL/sea-orm#1597 * space for migration file naming SeaQL/sea-orm#1570 * composite key up to 12 SeaQL/sea-orm#1508 * seaography integration SeaQL/sea-orm#1599 * QuerySelect SimpleExpr SeaQL/sea-orm#1702 * sqlErr SeaQL/sea-orm#1707 * migration check SeaQL/sea-orm#1519 * postgres array SeaQL/sea-orm#1565 * param intoString SeaQL/sea-orm#1439 * **skipped** re-export SeaQL/sea-orm#1661 * ping SeaQL/sea-orm#1627 * on empty do nothing SeaQL/sea-orm#1708 * on conflict do nothing SeaQL/sea-orm#1712 * **skipped** upgrade versions * active enum fail safe SeaQL/sea-orm#1374 * relation generation check SeaQL/sea-orm#1435 * entity generation bug SeaQL/sea-schema#105 * **skipped** bug fix that does not require edits * EnumIter change SeaQL/sea-orm#1535 * completed and fixed a previous todo SeaQL/sea-orm#1570 * amended wordings and structures * Edit * Remove temp file --------- Co-authored-by: Billy Chan <[email protected]>
🎉 Released In 0.12.1 🎉Thank you everyone for the contribution! |
PR Info
Dependencies:
This PR should be merged into master. But I want to substitute the changes of Update heck dependency #1520 for readability.
New Features
sea_orm_macros::EnumIterto implementstrum::IntoEnumIteratortrait for the derived enum (source code adapted from https://github.com/Peternator7/strum)Upgrades
strumto 0.24Breaking Changes
deriveandstrumfeatures tosea-orm-macrossea-strumdependency withstruminsea-ormsea_orm_macros::EnumIterinstead ofstrum::EnumIteron the root ofsea-orm