#sqlx #postgresql #tester #testing #database #automatic #drop

sqlx-database-tester-wsf

a simple tool to test sqlx with postgres, automatically create a database and drop it after test

4 releases

0.1.3 Dec 2, 2023
0.1.2 Dec 2, 2023
0.1.1 Dec 2, 2023
0.1.0 Dec 2, 2023

#1699 in Development tools

21 downloads per month

MIT license

8KB
114 lines

sqlx-database-tester-wsf

sqlx tester for postgres, work with tokio only.

create one database at start of testing and destory after test ending.

How to use it

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!

License

This project is distributed under the terms of MIT.

See LICENSE for details.

Copyright 2021 SF Wu

Dependencies

~18–30MB
~538K SLoC