Open roy-ganz opened 3 years ago
This is currently not possible, because embedded structs are not supported
#[derive(Toql)] struct User { #[toql(key)] pub id: u64, pub modified_by: UserKey // <-- UserKey{ id: u64} }
An embedded UserKey would map the modified_by column from User to the id field of UserKey.
UserKey
modified_by
id
Note that this actually compiles, but fails with a runtime error (expected field XX to be selected).
Workaround: Use u64 directly or join on a additional struct (eg. UserRef).
u64
UserRef
To implement embedding decide on column renaming, composite keys and general structs handling.
This is currently not possible, because embedded structs are not supported
An embedded
UserKey
would map themodified_by
column from User to theid
field of UserKey.Note that this actually compiles, but fails with a runtime error (expected field XX to be selected).
Workaround: Use
u64
directly or join on a additional struct (eg.UserRef
).To implement embedding decide on column renaming, composite keys and general structs handling.