Crates.io | pgdb-lib-rs |
lib.rs | pgdb-lib-rs |
version | 0.1.2 |
source | src |
created_at | 2022-09-29 02:59:32.880502 |
updated_at | 2022-10-01 19:23:57.651734 |
description | A simple database wrapper for |
homepage | |
repository | |
max_upload_size | |
id | 676328 |
size | 3,653 |
*** 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 ");
}