rs-db-driver-postgresql-diesel 0.1.0
PostgreSQL: diesel (the driver, re-exported, with a runnable example)
Install
cargo add rs-db-driver-postgresql-diesel --registry rupm
In Ruststudio: Packages, search for rs-db-driver-postgresql-diesel, 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-diesel
PostgreSQL - diesel: ORM and query builder
Add it with `rupm add rs-db-driver-postgresql-diesel` (or `cargo add rs-db-driver-postgresql-diesel --registry rupm`). The driver `diesel` is re-exported as `rs_db_driver_postgresql_diesel::diesel`.
Also serves: CockroachDB
**Needs on the PC:** the PostgreSQL client library (libpq) at build time
## Example
```rust
use diesel::prelude::*;
use diesel::sql_query;
fn main() -> Result<(), diesel::result::Error> {
let mut conn = PgConnection::establish("postgres://user:password@localhost/mydb").expect("cannot connect");
sql_query("SELECT 1").execute(&mut conn)?;
println!("connected");
Ok(())
}
```