mirror of
https://github.com/ilyakooo0/reshape.git
synced 2024-11-23 01:36:48 +03:00
16 lines
530 B
Rust
16 lines
530 B
Rust
use postgres::{Client, NoTls};
|
|
use reshape::Reshape;
|
|
|
|
pub fn setup() -> (Reshape, Client, Client) {
|
|
let connection_string = std::env::var("POSTGRES_CONNECTION_STRING")
|
|
.unwrap_or("postgres://postgres:postgres@localhost/reshape_test".to_string());
|
|
|
|
let old_db = Client::connect(&connection_string, NoTls).unwrap();
|
|
let new_db = Client::connect(&connection_string, NoTls).unwrap();
|
|
|
|
let mut reshape = Reshape::new(&connection_string).unwrap();
|
|
reshape.remove().unwrap();
|
|
|
|
(reshape, old_db, new_db)
|
|
}
|