mirror of
https://github.com/launchbadge/sqlx.git
synced 2026-04-30 05:54:20 +00:00
Formatting
This commit is contained in:
committed by
Ryan Leckey
parent
19f086cc23
commit
f1c1d9ae07
@@ -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?)
|
||||
|
||||
@@ -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};
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user