Formatting

This commit is contained in:
Jesper Axelsson
2020-04-17 10:19:22 +02:00
committed by Ryan Leckey
parent 19f086cc23
commit f1c1d9ae07
3 changed files with 10 additions and 8 deletions

View File

@@ -141,23 +141,25 @@ async fn run_drop_database(migrator: &dyn DatabaseMigrator) -> Result<()> {
let db_exists = migrator.check_if_database_exists(&db_name).await?;
if db_exists {
loop {
println!("\nAre you sure you want to drop the database: {}? Y/n", db_name);
println!(
"\nAre you sure you want to drop the database: {}? Y/n",
db_name
);
let mut input = String::new();
io::stdin()
.read_line(&mut input)
.context("Failed to read line")?;
match input.trim() {
"Y" => break,
"N" => return Ok(()),
"n" => return Ok(()),
_ => continue,
};
};
}
println!("Dropping database: {}", db_name);
Ok(migrator.drop_database(&db_name).await?)

View File

@@ -1,9 +1,9 @@
use sqlx::pool::PoolConnection;
use sqlx::postgres::PgRow;
use sqlx::Connect;
use sqlx::Executor;
use sqlx::PgConnection;
use sqlx::PgPool;
use sqlx::Executor;
use sqlx::Row;
use anyhow::{anyhow, Context, Result};

View File

@@ -104,7 +104,7 @@ impl DatabaseMigrator for Sqlite {
Ok(())
}
//
//
async fn begin_migration(&self) -> Result<Box<dyn MigrationTransaction>> {
// let pool = SqlitePool::new(&self.db_url)
// .await