Crates.io | sqlx-database-tester-wsf |
lib.rs | sqlx-database-tester-wsf |
version | 0.1.3 |
source | src |
created_at | 2023-12-02 03:47:09.630566 |
updated_at | 2023-12-02 04:54:29.71524 |
description | a simple tool to test sqlx with postgres, automatically create a database and drop it after test. |
homepage | https://github.com/wsfy15/ |
repository | https://github.com/wsfy15/ |
max_upload_size | |
id | 1055880 |
size | 20,057 |
sqlx tester for postgres, work with tokio only.
create one database at start of testing and destory after test ending.
let tdb = TestDB::new("localhost", 5432, "postgres", "123456", "./migrations");
let pool = tdb.get_pool().await;
// do something with pool
// when tdb get dropped, the database will be dropped
Have fun with this crate!
This project is distributed under the terms of MIT.
See LICENSE for details.
Copyright 2021 SF Wu