Closed SpartanPlume closed 2 months ago
When using a separate insertion struct, the id field is mandatory while it should not.
Dependencies:
[dependencies] ormlite = { version = "0.18", features = ["postgres"] }
Reproducer:
use ormlite::model::*; #[derive(Model, Debug)] pub struct Person { pub id: i32, pub name: String, } #[derive(Model, Debug)] #[ormlite(table = "person")] pub struct InsertPerson { pub name: String, }
Errors:
error: proc-macro derive panicked --> src/main.rs:3:10 | 3 | #[derive(Model, Debug)] | ^^^^^ | = help: message: No column marked with #[ormlite(primary_key)], and no column named id, uuid, person_id, or person_uuid error: proc-macro derive panicked --> src/main.rs:9:10 | 9 | #[derive(Model, Debug)] | ^^^^^ | = help: message: No column marked with #[ormlite(primary_key)], and no column named id, uuid, person_id, or person_uuid
As you can see, the error is appearing on both the insertion struct and the original one.
If the id field is added, the errors disappear.
See #54
When using a separate insertion struct, the id field is mandatory while it should not.
Dependencies:
Reproducer:
Errors:
As you can see, the error is appearing on both the insertion struct and the original one.
If the id field is added, the errors disappear.