* sea-orm-cli Implement derives & attributes parameters for entity generation (#1124)
* implement derives & attributes for cli
* fmt and clippy fix
* use comma delimiter for attributes arg
* Update help message use `'` instead of `"` to quote
* Refactoring
* remove unnecessary cloning
Co-authored-by: Billy Chan <ccw.billy.123@gmail.com>
* [CLI] generate model with extra derives and attributes
* clippy
Co-authored-by: Isaiah Gamble <77396670+tsar-boomba@users.noreply.github.com>
* Add serde skip options for hidden columns to the CLI (#1171)
* Add serde skip options for hidden columns to the CLI
* Resolve rustfmt and clippy issues
* Use SerdeDeriveOptions instead of WithSerde in tests
* Resolve upstream conflict
Co-authored-by: Billy Chan <ccw.billy.123@gmail.com>
* [CLI] serde_skip_hidden_column
* clippy
* clippy
Co-authored-by: Jacob Trueb <jtrueb@northwestern.edu>
* Add cli feature on sea-orm-migration
* Add cli feature on sea-orm-cli
* Remove async-std feature and add async-std in the default feature
Co-authored-by: Billy Chan <ccw.billy.123@gmail.com>
* Enable migration generation in modules
Previously, migration generation expected migrations
to be at the crate root.
* Fix migration backup file extension
* Document behavior of migration_dir
* Implement entity writer context and date time crate enum
* Use entity writer context to render correct rust type according to chrono/time enum
* Add unit test to get col rs type with time crate
* Add date-time-crate flag for cli
* Edit usage of updated get_rs_type method
* Use arg enum for date time crate
* Move date time crate arg enum conversion into commands module
* Directly use arg enum
* Fixing import issues for arg enum w/ help from Billy
* bump clap to 3.1.17
sea-orm-migration: bump clap version to 3.1.17
sea-orm-cli: use clap derive API instead of builder API
sea-orm-migration: use clap derive
* Fix clippy warnings
* Migration CLI verbose with default value
* bump clap to 3.2
Co-authored-by: Thanh Van <tvt@smonv.com>
Co-authored-by: Billy Chan <ccw.billy.123@gmail.com>
* feat(sea-orm-cli): output lof about generated file name.
https://github.com/SeaQL/sea-orm/issues/722
* include column names in info
* cargo fmt
* Update sea-orm-cli/src/commands.rs
Avoid multiple initializations
Co-authored-by: Billy Chan <ccw.billy.123@gmail.com>
* show info per column
* refactor: use write! macro
* Refactoring
Co-authored-by: Billy Chan <ccw.billy.123@gmail.com>
* CI compile migrator CLI
* sea-orm-migration's CLI with only migration subcommand
* Fix clippy warnings
* Fixup
* `sea-orm-cli migrate init`: write sea-orm-migration version based on CLI version
* feat(cli): add 'migration generate' subcommand
This subcommend will create a new, empty migration.
* feat(deps): add chrono crate
This crate will allow me to fetch the current date and time required for
generating the migration filename.
* feat(cli): generate migration filename
* feat(cli): read template, replace migration name
* feat(cli): write modified content to file
* feat(deps): add regex crate
Allows me to parse the lib.rs file containing the migrator logic.
* fix(cli): add missing chrono import
* feat(cli): mod declaration for new migration
This modifies the existing migator file, adding a module declaration for
the newly generated migration.
* feat(cli): regenerate migration vector
* feat(cli): write updated migrator file to disk
This completes updating the migrator file with the new migration
information.
* docs(cli): additional docstring
* refactor(cli): move logic into functions
* test(cli): create new migration happy path
* test(cli): update migrator happy path
* fix(cli): dedicated tmp dir for test
This avoids conflicts with the other tests.
* style(cli): align generated code with cargofmt
As suggested by @billy1624 in the review of #656.
* feat(cli): harden regex against extra spaces
As suggested by @billy1624 in the review of #656.
Co-authored-by: Billy Chan <ccw.billy.123@gmail.com>