preparing 0.5.6 release (#1382)

* fix(pool): reenable connection reaper

* fix warnings

* chore: bump published crates to 0.5.6

* chore: update CHANGELOG.md for 0.5.6
This commit is contained in:
Austin Bonander 2021-08-17 12:44:24 -07:00 committed by GitHub
parent 774880d17c
commit 6bb1c716bd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 64 additions and 38 deletions

View file

@ -5,6 +5,34 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## 0.5.6 - 2021-08-16
A large bugfix release, including but not limited to:
* [[#1329]] Implement `MACADDR` type for Postgres [[@nomick]]
* [[#1363]] Fix `PortalSuspended` for array of composite types in Postgres [[@AtkinsChang]]
* [[#1320]] Reimplement `sqlx::Pool` internals using `futures-intrusive` [[@abonander]]
* This addresses a number of deadlocks/stalls on acquiring connections from the pool.
* [[#1332]] Macros: tell the compiler about external files/env vars to watch [[@abonander]]
* Includes `sqlx build-script` to create a `build.rs` to watch `migrations/` for changes.
* Nightly users can try `RUSTFLAGS=--cfg sqlx_macros_unstable` to tell the compiler
to watch `migrations/` for changes instead of using a build script.
* See the new section in the docs for `sqlx::migrate!()` for details.
* [[#1351]] Fix a few sources of segfaults/errors in SQLite driver [[@abonander]]
* Includes contributions from [[@link2ext]] and [[@madadam]].
* [[#1323]] Keep track of column typing in SQLite EXPLAIN parsing [[@marshoepial]]
* This fixes errors in the macros when using `INSERT/UPDATE/DELETE ... RETURNING ...` in SQLite.
[A total of 25 pull requests][0.5.6-prs] were merged this release cycle!
[#1329]: https://github.com/launchbadge/sqlx/pull/1329
[#1363]: https://github.com/launchbadge/sqlx/pull/1363
[#1320]: https://github.com/launchbadge/sqlx/pull/1320
[#1332]: https://github.com/launchbadge/sqlx/pull/1332
[#1351]: https://github.com/launchbadge/sqlx/pull/1351
[#1323]: https://github.com/launchbadge/sqlx/pull/1323
[0.5.6-prs]: https://github.com/launchbadge/sqlx/pulls?q=is%3Apr+is%3Amerged+merged%3A2021-05-24..2021-08-17
## 0.5.5 - 2021-05-24
- [[#1242]] Fix infinite loop at compile time when using query macros [[@toshokan]]
@ -925,3 +953,8 @@ Fix docs.rs build by enabling a runtime feature in the docs.rs metadata in `Carg
[@feikesteenbergen]: https://github.com/feikesteenbergen
[@etcaton]: https://github.com/ETCaton
[@toshokan]: https://github.com/toshokan
[@nomick]: https://github.com/nomick
[@marshoepial]: https://github.com/marshoepial
[@link2ext]: https://github.com/link2ext
[@madadam]: https://github.com/madadam
[@AtkinsChang]: https://github.com/AtkinsChang

10
Cargo.lock generated
View file

@ -2290,7 +2290,7 @@ dependencies = [
[[package]]
name = "sqlx"
version = "0.5.5"
version = "0.5.6"
dependencies = [
"anyhow",
"async-std",
@ -2323,7 +2323,7 @@ dependencies = [
[[package]]
name = "sqlx-cli"
version = "0.5.5"
version = "0.5.6"
dependencies = [
"anyhow",
"async-trait",
@ -2346,7 +2346,7 @@ dependencies = [
[[package]]
name = "sqlx-core"
version = "0.5.5"
version = "0.5.6"
dependencies = [
"ahash",
"atoi",
@ -2482,7 +2482,7 @@ dependencies = [
[[package]]
name = "sqlx-macros"
version = "0.5.5"
version = "0.5.6"
dependencies = [
"dotenv",
"either",
@ -2503,7 +2503,7 @@ dependencies = [
[[package]]
name = "sqlx-rt"
version = "0.5.5"
version = "0.5.6"
dependencies = [
"actix-rt",
"async-native-tls",

View file

@ -18,7 +18,7 @@ members = [
[package]
name = "sqlx"
version = "0.5.5"
version = "0.5.6"
license = "MIT OR Apache-2.0"
readme = "README.md"
repository = "https://github.com/launchbadge/sqlx"

View file

@ -1,6 +1,6 @@
[package]
name = "sqlx-cli"
version = "0.5.5"
version = "0.5.6"
description = "Command-line utility for SQLx, the Rust SQL toolkit."
edition = "2018"
readme = "README.md"

View file

@ -1,6 +1,6 @@
[package]
name = "sqlx-core"
version = "0.5.5"
version = "0.5.6"
repository = "https://github.com/launchbadge/sqlx"
description = "Core of SQLx, the rust SQL toolkit. Not intended to be used directly."
license = "MIT OR Apache-2.0"

View file

@ -132,13 +132,6 @@ impl<DB: Database> DerefMut for Idle<DB> {
}
}
impl<'s, C> Floating<'s, C> {
pub fn into_leakable(self) -> C {
self.guard.cancel();
self.inner
}
}
impl<'s, DB: Database> Floating<'s, Live<DB>> {
pub fn new_live(conn: DB::Connection, guard: DecrementSizeGuard<'s>) -> Self {
Self {

View file

@ -4,16 +4,16 @@ use crate::connection::Connection;
use crate::database::Database;
use crate::error::Error;
use crate::pool::{deadline_as_timeout, PoolOptions};
use crossbeam_queue::{ArrayQueue, SegQueue};
use futures_core::task::{Poll, Waker};
use crossbeam_queue::ArrayQueue;
use futures_intrusive::sync::{Semaphore, SemaphoreReleaser};
use futures_util::future;
use std::cmp;
use std::mem;
use std::ptr;
use std::sync::atomic::{AtomicBool, AtomicU32, Ordering};
use std::sync::{Arc, Weak};
use std::task::Context;
use std::sync::Arc;
use std::time::{Duration, Instant};
/// Ihe number of permits to release to wake all waiters, such as on `SharedPool::close()`.
@ -90,7 +90,7 @@ impl<DB: Database> SharedPool<DB> {
.await;
while let Some(idle) = self.idle_conns.pop() {
idle.live.float(self).close().await;
let _ = idle.live.float(self).close().await;
}
}
@ -322,16 +322,16 @@ fn spawn_reaper<DB: Database>(pool: &Arc<SharedPool<DB>>) {
(None, None) => return,
};
// let pool = Arc::clone(&pool);
//
// sqlx_rt::spawn(async move {
// while !pool.is_closed() {
// if !pool.idle_conns.is_empty() {
// do_reap(&pool).await;
// }
// sqlx_rt::sleep(period).await;
// }
// });
let pool = Arc::clone(&pool);
sqlx_rt::spawn(async move {
while !pool.is_closed() {
if !pool.idle_conns.is_empty() {
do_reap(&pool).await;
}
sqlx_rt::sleep(period).await;
}
});
}
async fn do_reap<DB: Database>(pool: &SharedPool<DB>) {

View file

@ -6,7 +6,6 @@ use crate::{
types::Type,
};
use byteorder::{BigEndian, ByteOrder};
use std::convert::TryFrom;
use std::{
io,
ops::{Add, AddAssign, Sub, SubAssign},
@ -97,6 +96,8 @@ impl PgMoney {
/// [`Decimal`]: crate::types::Decimal
#[cfg(feature = "decimal")]
pub fn from_decimal(mut decimal: rust_decimal::Decimal, locale_frac_digits: u32) -> Self {
use std::convert::TryFrom;
// this is all we need to convert to our expected locale's `frac_digits`
decimal.rescale(locale_frac_digits);

View file

@ -14,10 +14,9 @@ use libsqlite3_sys::{
sqlite3_column_bytes, sqlite3_column_count, sqlite3_column_database_name,
sqlite3_column_decltype, sqlite3_column_double, sqlite3_column_int, sqlite3_column_int64,
sqlite3_column_name, sqlite3_column_origin_name, sqlite3_column_table_name,
sqlite3_column_type, sqlite3_column_value, sqlite3_db_handle, sqlite3_finalize, sqlite3_reset,
sqlite3_sql, sqlite3_step, sqlite3_stmt, sqlite3_stmt_readonly, sqlite3_table_column_metadata,
sqlite3_value, SQLITE_DONE, SQLITE_MISUSE, SQLITE_OK, SQLITE_ROW, SQLITE_TRANSIENT,
SQLITE_UTF8,
sqlite3_column_type, sqlite3_column_value, sqlite3_db_handle, sqlite3_finalize, sqlite3_sql,
sqlite3_stmt, sqlite3_stmt_readonly, sqlite3_table_column_metadata, sqlite3_value,
SQLITE_MISUSE, SQLITE_OK, SQLITE_TRANSIENT, SQLITE_UTF8,
};
use crate::error::{BoxDynError, Error};

View file

@ -1,6 +1,6 @@
[package]
name = "sqlx-macros"
version = "0.5.5"
version = "0.5.6"
repository = "https://github.com/launchbadge/sqlx"
description = "Macros for SQLx, the rust SQL toolkit. Not intended to be used directly."
license = "MIT OR Apache-2.0"

View file

@ -1,6 +1,6 @@
[package]
name = "sqlx-rt"
version = "0.5.5"
version = "0.5.6"
repository = "https://github.com/launchbadge/sqlx"
license = "MIT OR Apache-2.0"
description = "Runtime abstraction used by SQLx, the Rust SQL toolkit. Not intended to be used directly."