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:
Austin Bonander
2023-07-03 14:37:37 -07:00
committed by GitHub
parent 1bdbedabdc
commit dcb58b0e2c
26 changed files with 1392 additions and 107 deletions

View File

@@ -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(())
}