#wrapper #postgresql

pgdb-lib-rs

A simple database wrapper for

3 releases

0.1.2 Oct 1, 2022
0.1.1 Sep 30, 2022
0.1.0 Sep 29, 2022

#2141 in Database interfaces

MIT license

4KB

Readme

*** Not Ready for PUBLIC USE. Suggestions/Reviews are welcome! ***

This is a simple Rust Wrapper over SQLX and Postgres.

To connect to Postgres, use the following

DATABASE_URL=postgres://postgres:postgres@localhost:5432/fenvoxdb?currentSchema=app
async fn main(){
    let db = Database::new().await.expect("Database connection Failed");
    let row: (i64,) = sqlx::query_as("SELECT $1")
        .bind(150_i64)
        .fetch_one(db.get_pool()).await.expect("error occured ");
}

Dependencies

~12–24MB
~359K SLoC