rs-db-driver-postgresql-sqlx 0.1.0
PostgreSQL: sqlx (the driver, re-exported, with a runnable example)
Install
cargo add rs-db-driver-postgresql-sqlx --registry rupm
In Ruststudio: Packages, search for rs-db-driver-postgresql-sqlx, Install.
Owner: Rust Studio. Licence: MIT OR Apache-2.0. Total downloads: 0. Published 2026-11-23.
Versions
- 0.1.0 2026-11-23
README
# rs-db-driver-postgresql-sqlx
PostgreSQL - sqlx: async SQL toolkit with a connection pool
Add it with `rupm add rs-db-driver-postgresql-sqlx` (or `cargo add rs-db-driver-postgresql-sqlx --registry rupm`). The driver `sqlx` is re-exported as `rs_db_driver_postgresql_sqlx::sqlx`.
Also serves: CockroachDB, YugabyteDB, TimescaleDB, Amazon Aurora PostgreSQL, Amazon Redshift
This driver is async: your project also needs an async runtime, for example `cargo add tokio --features macros,rt-multi-thread`.
## Example
```rust
use sqlx::postgres::PgPoolOptions;
#[tokio::main]
async fn main() -> Result<(), sqlx::Error> {
// Change the connection string to your server.
let pool = PgPoolOptions::new().max_connections(5).connect("postgres://user:password@localhost:5432/mydb").await?;
let row: (i64,) = sqlx::query_as("SELECT 1").fetch_one(&pool).await?;
println!("the server answered {}", row.0);
Ok(())
}
```