4 Commits

Author SHA1 Message Date
Billy Chan
9282ce2ded
Cont. Add serde skip options for hidden columns to the CLI (#1320)
* 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>
2022-12-20 00:43:21 +08:00
Billy Chan
3f00725ee2
Cli serde skip deserialize for primary key option (#1186) (#1318)
* Cli serde skip deserialize for primary key option (#1186)

* Add CLI option to skip primary keys with serde

Implements: https://github.com/SeaQL/sea-orm/issues/841

* Codegen: fix tests

* complete skip_deserialize cli feature

* run fmt

* fix tests

Co-authored-by: witcher <witcher@wiredspace.de>

* [cli] should be `#[serde(skip_deserializing)]`

* [CLI] code refactor

* [cli] rename

Co-authored-by: Isaiah Gamble <77396670+tsar-boomba@users.noreply.github.com>
Co-authored-by: witcher <witcher@wiredspace.de>
2022-12-19 22:11:45 +08:00
Lingxiang "LinG" Wang
a349f13fd7
Struct / enum derive PartialEq should also derive Eq (#988)
* add Eq

* Fix clippy warnings

* Fix test cases

Co-authored-by: Billy Chan <ccw.billy.123@gmail.com>
2022-09-25 10:38:05 +08:00
Tim Eggert
b6c5d71fe2 Introduce optional serde support for model code generation
This introduces several things to optionally support automatic derive attributes for `serde::{Deserialize, Serialize}` for the generated models:
- introduces a `WithSerde` enum to indicate if Serialize, Deserialize, or even both should be derived from,
- adds an optional cli argument `--with-serde [none: default, serialize, deserialize, both]`
- adds test harness for both compact and expanded generation
2021-10-11 14:55:00 +02:00