Wulf / dsync

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

WIP: try to use `quote` + `prettyplease` #132

Open hasezoey opened 8 months ago

hasezoey commented 8 months ago

This PR is a POC (which may be extended upon) to use quote + prettyplease for code generation instead of a string.

limitations i have found while using quote + syn + prettyplease:

aside from those problems there are some things which could be done, but i have not done yet:

re #105

PS: i know the tests are failing, i have just included 2 updated test cases which cover the all the cases this PR touches, and to simplify a quick review


my personal opinion is that at least in the current state (see limitations), the string representation is a lot better; but we should maybe still store proc-macro2 / syn types in things like StructField or names, to maybe ensure they are valid idents and stuff