-
-
Notifications
You must be signed in to change notification settings - Fork 660
Description
Feature Request: Allow Custom Filename for Generated Active Enums via CLI Argument
Motivation
Currently, the generated file for active enums is always named sea_orm_active_enums.rs.
This makes it harder to integrate with projects that have custom naming conventions or when multiple enum files need to be generated separately.
Allowing the filename to be set dynamically via a CLI argument would give developers more flexibility and better project structure control.
Proposed Solutions
Introduce a new CLI argument (for example --active-enum-file <FILENAME>) to specify the output filename of the active enums.
- Default behavior (no argument provided): still generate
sea_orm_active_enums.rsto maintain backward compatibility. - If the argument is set, use the provided name instead of the hardcoded
"sea_orm_active_enums.rs"string insideEntityWriter::write_sea_orm_active_enums.
This approach preserves existing workflows while enabling customization for advanced use cases.
Additional Information
- Example usage:
sea-orm-cli generate entity --active-enum-file enums.rs
This would result in enums.rs being generated instead of sea_orm_active_enums.rs.
-
The implementation would mainly involve replacing the hardcoded string in
writer.rswith a configurable parameter passed down from the CLI layer. -
Backward compatibility is maintained since the argument would be optional.