Features for sqlx for Cargo.toml

Hello,
I’m posting here because I still don’t fully understand how to use SQLX to connect to different relational databases. I’m currently building the backend for a blog and my database will be PostgreSQL, so when I add the settings to Cargo.toml, I’m not sure whether to use runtime-async-std or runtime-tokio.
I’ve read the documentation, but I’ve found it difficult to fully grasp this concept.

[package]
name = "rust-blog-backend"
version = "0.1.0"
edition = "2024"

[lib]
name = "lib"
path = "src/lib.rs"

[dependencies]
actix-web = "4.13.0"
chrono = { version = "0.4.45", features = ["serde"] }
serde_json = "1.0.150"
serde = { version = "1.0.228", features = ["derive"] }
actix-cors = "0.7.1"
sqlx = { version = "0.9.0", features = ["postgres"] }

Thank you very much for your understanding and for any help you can offer.

i do not know the answer! i would suggest though you pick the same runtime used by your chosen web framework.

if you are not sure, tokio is probably the safer one to choose.

tokio is the default runtime for most of rust's async ecosystem. and you can always switch to a different one, after you get some experience with the default configuration.

Async std has been discontinued

@chung @nerditation @rsn

Thank very much for comment, you comment are good help

You shouldn't enable just any feature, you should enable the one for the async runtime you're using.

Since you're using actix-web and actix uses tokio under the hood, you should then enable runtime-tokio