sea-orm
sea-orm copied to clipboard
Add CLI option to `sea-orm-cli` to skip primary keys with serde on generation of entities
PR Info
- Closes https://github.com/SeaQL/sea-orm/issues/841
Adds
- [ ] Command line argument
--skip-primary-key-deserialization
tosea-orm-cli
for the option to skip deserialization of primary keys with serde by adding#[serde(skip_deserialization)]
to the primary key
As the comment says, this adds the option to skip serializing primary keys with serde in entities generated by sea-orm-cli
.
The command line flag name is a bit long, so feel free to suggest a different name for it.
The implementation could use some work to feel better, so I'll take suggestions for this as well.
As of now clap
doesn't treat the new argument as only being allowed to be set when --with-serde
with a value other than none
is used.
Right, I didn't look at the tests. This might take a bit of time
I just noticed that skipping the primary key deserialization isn't added in the expanded formats. I'll fix that and push a new commit when I'm done. ETA this evening, hopefully. I'm also adding tests for this, as I haven't done that yet.
Thanks! @Witcher01
I'm not finding any time to implement this. If anyone else wants to have a go at this with my changes already there, feel free to keep working on this.