Wulf / dsync

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

feat: `--async` option for compiled binary (CLI) #96

Closed jjangga0214 closed 1 year ago

jjangga0214 commented 1 year ago

Hi!

When using compiled binary (by cargo install dsync, not cargo add dsync), --async option is not there. I hope it's to be supported.

What do you think?

hasezoey commented 1 year ago

When using compiled binary (by cargo install dsync, not cargo add dsync), --async option is not there.

you need to compile it with the feature enabled, async is not a default feature

use cargo install dsync --features async

jjangga0214 commented 1 year ago

Yes, but that does not mean it will create async code, in my experience. And the freedom to choose on Runtime is still cool, IMHO.

hasezoey commented 1 year ago

i dont quite understand what this issue is about, so some general information:

for async code to be generated, you need to:

https://github.com/Wulf/dsync/blob/007ace83c139f67e1d85ed4829cf0b6953d121df/src/bin/main.rs#L57-L60

jjangga0214 commented 1 year ago

Oh, I checked --help but missed reading --async. Probably I thought I did cargo install dsync --features async but actually cargo install dsync. Thanks for the clarification!