Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
jjangga0214 opened this issue Oct 17, 2023 · 4 comments
Closed

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

jjangga0214 opened this issue Oct 17, 2023 · 4 comments
Labels
question Further information is requested

Comments

@jjangga0214
Copy link

jjangga0214 commented Oct 17, 2023

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?

@jjangga0214 jjangga0214 changed the title async option for compiled binary feat: --async option for compiled binary Oct 17, 2023
@jjangga0214 jjangga0214 changed the title feat: --async option for compiled binary feat: --async option for compiled binary (CLI) Oct 17, 2023
@hasezoey
Copy link
Collaborator

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

@hasezoey hasezoey added the question Further information is requested label Oct 17, 2023
@jjangga0214
Copy link
Author

jjangga0214 commented Oct 17, 2023

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
Copy link
Collaborator

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

for async code to be generated, you need to:

  • enable feature async at compile time
  • enable via flag --async at runtime

dsync/src/bin/main.rs

Lines 57 to 60 in 007ace8

/// uses diesel_async for generated functions; see https://github.com/weiznich/diesel_async
#[arg(long = "async")]
#[cfg(feature = "async")]
pub use_async: bool,

@jjangga0214
Copy link
Author

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants