Missing downward feature `runtime-tokio`.
xuxiaocheng0201 opened this issue · 4 comments
xuxiaocheng0201 commented
Description
Enabled runtime-tokio
in sea-orm
but panics
either the `runtime-async-std` or `runtime-tokio` feature must be enabled
in sqlx-core
.
Steps to Reproduce
- Add
sea-orm = { version = "1.0.0-rc.3", features = ["sqlx-sqlite", "runtime-tokio"] }
toCargo.toml
- In
main.rs
:
use sea_orm::Database;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let connection = Database::connect("sqlite://1.db?mode=rwc").await?;
connection.ping().await?;
Ok(())
}
- Compile and run.
Expected Behavior
Normally run.
Actual Behavior
Panic:
thread 'main' panicked at D:\AppData\Languages\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
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Reproduces How Often
Always.
Workarounds
Missing downward feature.
Reproducible Example
Codes above.
Versions
I tested 1.0.0-rc.3
and 0.12.15
, both had this problem.
billy1624 commented
Hey @xuxiaocheng0201, runtime-tokio
is just a placeholder feature. It did nothing behind the scene. Please enable one of
runtime-tokio-native-tls
runtime-tokio-rustls
Lines 116 to 126 in 0ff000b
xuxiaocheng0201 commented
Hey @xuxiaocheng0201,
runtime-tokio
is just a placeholder feature. It did nothing behind the scene. Please enable one of
runtime-tokio-native-tls
runtime-tokio-rustls
Thanks @billy1624 .
But I only use the sqlite
backend, which needn't tls.
Enable runtime-tokio-native-tls
or runtime-tokio-rustls
resulted in additional unnecessary dependencies.