Wulf / dsync

Generate rust structs & query functions from diesel schema files
Other
70 stars 13 forks source link

feat: support `#[derive(QueryableByName)]` #97

Closed jjangga0214 closed 11 months ago

jjangga0214 commented 1 year ago

Hi!

I'd like to suggest to support QueryableByName derive.

This is useful for using sql_query.

How do you think?

hasezoey commented 1 year ago

to my understanding this derive needs to be added to the Read Struct (not Update or Create) and can be applied to all Read Structs (no special conditions, like Associations needs foreign_keys?)

Wulf commented 11 months ago

@jjangga0214 thanks for the suggestion and I agree @hasezoey, this is something we'd add to the Read struct. I don't see any harm in adding this. We should feature-gate this as it might increase compilation times, but have it included as part of the default feature set?