Shut down statement worker in Sqlite Connection::close (#1453)

* add explicit shutdown of sqlite statement worker in Connection::close()

Signed-off-by: Andrew Whitehead <cywolf@gmail.com>

* test sqlite database close method

Signed-off-by: Andrew Whitehead <cywolf@gmail.com>

* await worker shutdown after dropping SqliteConnection

Signed-off-by: Andrew Whitehead <cywolf@gmail.com>

* restore explicit drop

Signed-off-by: Andrew Whitehead <cywolf@gmail.com>
This commit is contained in:
Andrew Whitehead
2021-09-30 18:14:30 -07:00
committed by GitHub
parent 6e1c7a999a
commit ba3e373b7e
3 changed files with 44 additions and 5 deletions

View File

@@ -206,7 +206,8 @@ async fn it_executes_with_pool() -> anyhow::Result<()> {
async fn it_opens_in_memory() -> anyhow::Result<()> {
// If the filename is ":memory:", then a private, temporary in-memory database
// is created for the connection.
let _ = SqliteConnection::connect(":memory:").await?;
let conn = SqliteConnection::connect(":memory:").await?;
conn.close().await?;
Ok(())
}
@@ -215,7 +216,8 @@ async fn it_opens_in_memory() -> anyhow::Result<()> {
async fn it_opens_temp_on_disk() -> anyhow::Result<()> {
// If the filename is an empty string, then a private, temporary on-disk database will
// be created.
let _ = SqliteConnection::connect("").await?;
let conn = SqliteConnection::connect("").await?;
conn.close().await?;
Ok(())
}