mirror of
https://github.com/launchbadge/sqlx.git
synced 2026-03-23 10:38:57 +00:00
0.7.0 release (#2575)
* WIP preparing 0.7.0 release * fix: re-enable examples * fix doctests in `sqlx-core` * cherry-pick CHANGELOG entry for 0.6.3 * add actions workflow for examples * fix(cli): close connection after running migrations * fix examples * fix(sqlite): fix parsing of URLs via `Any` * fix(example): don't let Postgres `listen` example run forever * fix Postgres `transaction` example
This commit is contained in:
@@ -3,6 +3,7 @@ use anyhow::{bail, Context};
|
||||
use chrono::Utc;
|
||||
use console::style;
|
||||
use sqlx::migrate::{AppliedMigration, Migrate, MigrateError, MigrationType, Migrator};
|
||||
use sqlx::Connection;
|
||||
use std::borrow::Cow;
|
||||
use std::collections::{HashMap, HashSet};
|
||||
use std::fmt::Write;
|
||||
@@ -170,6 +171,8 @@ pub async fn info(migration_source: &str, connect_opts: &ConnectOpts) -> anyhow:
|
||||
}
|
||||
}
|
||||
|
||||
let _ = conn.close().await;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -249,6 +252,13 @@ pub async fn run(
|
||||
}
|
||||
}
|
||||
|
||||
// Close the connection before exiting:
|
||||
// * For MySQL and Postgres this should ensure timely cleanup on the server side,
|
||||
// including decrementing the open connection count.
|
||||
// * For SQLite this should checkpoint and delete the WAL file to ensure the migrations
|
||||
// were actually applied to the database file and aren't just sitting in the WAL file.
|
||||
let _ = conn.close().await;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -310,6 +320,8 @@ pub async fn revert(
|
||||
println!("No migrations available to revert");
|
||||
}
|
||||
|
||||
let _ = conn.close().await;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user