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

Set runtime features for sqlx. #2171

Merged
merged 2 commits into from
Mar 29, 2024
Merged

Set runtime features for sqlx. #2171

merged 2 commits into from
Mar 29, 2024

Conversation

bamidev
Copy link
Contributor

@bamidev bamidev commented Mar 24, 2024

When you add sea-orm simply like this:
sea-orm = { version = "0.12.15", features = ["runtime-tokio", "sqlx-sqlite"] }
It will complain about no runtime being selected:

thread 'main' panicked at /home/bamilab/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-core-0.7.4/src/pool/inner.rs:52:24:
either the `runtime-async-std` or `runtime-tokio` feature must be enabled

Even though I use the "runtime-tokio" feature.
It seems like it isn't being passed down to the sqlx crate.

For the moment I use the workaround of adding this to my Cargo.toml:
sqlx = { features = ["runtime-tokio"] }
But it is just a workaround.

@tyt2y3
Copy link
Member

tyt2y3 commented Mar 24, 2024

You're right. The original design is that you have to specify a runtime+tls feature flag , e.g. runtime-tokio-native-tls.
The runtime-tokio is transitive, and is simply used to signify that tokio has been enabled in sea-orm.

Cargo.toml Outdated Show resolved Hide resolved
Cargo.toml Outdated Show resolved Hide resolved
@tyt2y3 tyt2y3 mentioned this pull request Mar 27, 2024
2 tasks
@tyt2y3 tyt2y3 merged commit e34f09d into SeaQL:master Mar 29, 2024
16 of 32 checks passed
Copy link

github-actions bot commented Aug 4, 2024

🎉 Released In 1.0.0 🎉

Thank you everyone for the contribution!
This feature is now available in the latest release. Now is a good time to upgrade!
Your participation is what makes us unique; your adoption is what drives us forward.
You can support SeaQL 🌊 by starring our repos, sharing our libraries and becoming a sponsor ⭐.

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

Successfully merging this pull request may close these issues.

3 participants