mirror of
https://github.com/launchbadge/sqlx
synced 2024-11-10 06:24:16 +00:00
preparing 0.5.8 release (#1466)
* preparing 0.5.8 release * fix warnings before release
This commit is contained in:
parent
efde5c507f
commit
1b5dd6514b
12 changed files with 64 additions and 16 deletions
22
CHANGELOG.md
22
CHANGELOG.md
|
@ -5,6 +5,22 @@ 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.8 - 2021-10-01
|
||||
|
||||
[A total of 24 pull requests][0.5.8-prs] were merged this release cycle! Some highlights:
|
||||
|
||||
* [[#1289]] Support the `immutable` option on SQLite connections [[@djmarcin]]
|
||||
* [[#1295]] Support custom initial options for SQLite [[@ghassmo]]
|
||||
* Allows specifying custom `PRAGMA`s and overriding those set by SQLx.
|
||||
* [[#1345]] Initial support for Postgres `COPY FROM/TO`[[@montanalow], [@abonander]]
|
||||
* [[#1439]] Handle multiple waiting results correctly in MySQL [[@eagletmt]]
|
||||
|
||||
[#1289]: https://github.com/launchbadge/sqlx/pull/1289
|
||||
[#1295]: https://github.com/launchbadge/sqlx/pull/1295
|
||||
[#1345]: https://github.com/launchbadge/sqlx/pull/1345
|
||||
[#1439]: https://github.com/launchbadge/sqlx/pull/1439
|
||||
[0.5.8-prs]: https://github.com/launchbadge/sqlx/pulls?q=is%3Apr+is%3Amerged+merged%3A2021-08-21..2021-10-01
|
||||
|
||||
## 0.5.7 - 2021-08-20
|
||||
|
||||
* [[#1392]] use `resolve_path` when getting path for `include_str!()` [[@abonander]]
|
||||
|
@ -967,4 +983,8 @@ Fix docs.rs build by enabling a runtime feature in the docs.rs metadata in `Carg
|
|||
[@marshoepial]: https://github.com/marshoepial
|
||||
[@link2ext]: https://github.com/link2ext
|
||||
[@madadam]: https://github.com/madadam
|
||||
[@AtkinsChang]: https://github.com/AtkinsChang
|
||||
[@AtkinsChang]: https://github.com/AtkinsChang
|
||||
[@djmarcin]: https://github.com/djmarcin
|
||||
[@ghassmo]: https://github.com/ghassmo
|
||||
[@eagletmt]: https://github.com/eagletmt
|
||||
[@montanalow]: https://github.com/montanalow
|
10
Cargo.lock
generated
10
Cargo.lock
generated
|
@ -2333,7 +2333,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "sqlx"
|
||||
version = "0.5.7"
|
||||
version = "0.5.8"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"async-std",
|
||||
|
@ -2366,7 +2366,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "sqlx-cli"
|
||||
version = "0.5.7"
|
||||
version = "0.5.8"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"async-trait",
|
||||
|
@ -2389,7 +2389,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "sqlx-core"
|
||||
version = "0.5.7"
|
||||
version = "0.5.8"
|
||||
dependencies = [
|
||||
"ahash",
|
||||
"atoi",
|
||||
|
@ -2526,7 +2526,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "sqlx-macros"
|
||||
version = "0.5.7"
|
||||
version = "0.5.8"
|
||||
dependencies = [
|
||||
"dotenv",
|
||||
"either",
|
||||
|
@ -2546,7 +2546,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "sqlx-rt"
|
||||
version = "0.5.7"
|
||||
version = "0.5.8"
|
||||
dependencies = [
|
||||
"actix-rt",
|
||||
"async-native-tls",
|
||||
|
|
|
@ -18,7 +18,7 @@ members = [
|
|||
|
||||
[package]
|
||||
name = "sqlx"
|
||||
version = "0.5.7"
|
||||
version = "0.5.8"
|
||||
license = "MIT OR Apache-2.0"
|
||||
readme = "README.md"
|
||||
repository = "https://github.com/launchbadge/sqlx"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "sqlx-cli"
|
||||
version = "0.5.7"
|
||||
version = "0.5.8"
|
||||
description = "Command-line utility for SQLx, the Rust SQL toolkit."
|
||||
edition = "2018"
|
||||
readme = "README.md"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "sqlx-core"
|
||||
version = "0.5.7"
|
||||
version = "0.5.8"
|
||||
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"
|
||||
|
|
|
@ -223,7 +223,10 @@ impl Migrate for AnyConnection {
|
|||
AnyConnectionKind::MySql(conn) => conn.revert(migration),
|
||||
|
||||
#[cfg(feature = "mssql")]
|
||||
AnyConnectionKind::Mssql(_conn) => unimplemented!(),
|
||||
AnyConnectionKind::Mssql(_conn) => {
|
||||
let _ = migration;
|
||||
unimplemented!()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -138,9 +138,32 @@ impl<C: DerefMut<Target = PgConnection>> PgCopyIn<C> {
|
|||
})
|
||||
}
|
||||
|
||||
/// Returns `true` if Postgres is expecting data in text or CSV format.
|
||||
pub fn is_textual(&self) -> bool {
|
||||
self.response.format == 0
|
||||
}
|
||||
|
||||
/// Returns the number of columns expected in the input.
|
||||
pub fn num_columns(&self) -> usize {
|
||||
assert_eq!(
|
||||
self.response.num_columns as usize,
|
||||
self.response.format_codes.len(),
|
||||
"num_columns does not match format_codes.len()"
|
||||
);
|
||||
self.response.format_codes.len()
|
||||
}
|
||||
|
||||
/// Check if a column is expecting data in text format (`true`) or binary format (`false`).
|
||||
///
|
||||
/// ### Panics
|
||||
/// If `column` is out of range according to [`.num_columns()`][Self::num_columns].
|
||||
pub fn column_is_textual(&self, column: usize) -> bool {
|
||||
self.response.format_codes[column] == 0
|
||||
}
|
||||
|
||||
/// Send a chunk of `COPY` data.
|
||||
///
|
||||
/// If you're copying data from an `AsyncRead`, maybe consider [Self::copy_from] instead.
|
||||
/// If you're copying data from an `AsyncRead`, maybe consider [Self::read_from] instead.
|
||||
pub async fn send(&mut self, data: impl Deref<Target = [u8]>) -> Result<&mut Self> {
|
||||
self.conn
|
||||
.as_deref_mut()
|
||||
|
|
|
@ -88,7 +88,8 @@ impl TryFrom<&'_ Decimal> for PgNumeric {
|
|||
type Error = BoxDynError;
|
||||
|
||||
fn try_from(decimal: &Decimal) -> Result<Self, BoxDynError> {
|
||||
if decimal.is_zero() {
|
||||
// `Decimal` added `is_zero()` as an inherent method in a more recent version
|
||||
if Zero::is_zero(decimal) {
|
||||
return Ok(PgNumeric::Number {
|
||||
sign: PgNumericSign::Positive,
|
||||
scale: 0,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "sqlx-macros"
|
||||
version = "0.5.7"
|
||||
version = "0.5.8"
|
||||
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"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "sqlx-rt"
|
||||
version = "0.5.7"
|
||||
version = "0.5.8"
|
||||
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."
|
||||
|
|
|
@ -1148,7 +1148,7 @@ async fn it_can_abort_copy_in() -> anyhow::Result<()> {
|
|||
)
|
||||
.await?;
|
||||
|
||||
let mut copy = conn
|
||||
let copy = conn
|
||||
.copy_in_raw(
|
||||
r#"
|
||||
COPY users (id) FROM STDIN WITH (FORMAT CSV, HEADER);
|
||||
|
@ -1201,6 +1201,7 @@ async fn it_can_copy_out() -> anyhow::Result<()> {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
#[sqlx_macros::test]
|
||||
async fn test_issue_1254() -> anyhow::Result<()> {
|
||||
#[derive(sqlx::Type)]
|
||||
#[sqlx(type_name = "pair")]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
use sqlx::Sqlite;
|
||||
use sqlx_test::{new, test_type};
|
||||
use sqlx_test::test_type;
|
||||
|
||||
#[derive(Debug, PartialEq, sqlx::Type)]
|
||||
#[repr(u32)]
|
||||
|
|
Loading…
Reference in a new issue