use sqlx for migrations
This commit is contained in:
		
							parent
							
								
									466195193d
								
							
						
					
					
						commit
						69374ea424
					
				| @ -31,8 +31,11 @@ pub struct PostgresGateway { | ||||
| 
 | ||||
| impl PostgresGateway { | ||||
|     pub fn new(host: &str, dbname: &str, username: &str, password: &str) -> PostgresGateway { | ||||
|         // the postgres dep can be removed once refinery supports sqlx
 | ||||
|         let mut conn = Client::connect(&format!("host='{}' dbname='{}' user='{}' password='{}'", host, dbname, username, password), NoTls).unwrap(); | ||||
|         let mut conn = refinery::config::Config::new(refinery::config::ConfigDbType::Postgres) | ||||
|             .set_db_host(&host) | ||||
|             .set_db_user(&username) | ||||
|             .set_db_pass(&password) | ||||
|             .set_db_name(&dbname); | ||||
|         embedded::migrations::runner().run(&mut conn).unwrap(); | ||||
| 
 | ||||
|         let pool = async_std::task::block_on(async move { | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user