Skip to content

Commit 1b5dd65

Browse files
authored
preparing 0.5.8 release (#1466)
* preparing 0.5.8 release * fix warnings before release
1 parent efde5c5 commit 1b5dd65

File tree

12 files changed

+64
-16
lines changed

12 files changed

+64
-16
lines changed

CHANGELOG.md

+21-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,22 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## 0.5.8 - 2021-10-01
9+
10+
[A total of 24 pull requests][0.5.8-prs] were merged this release cycle! Some highlights:
11+
12+
* [[#1289]] Support the `immutable` option on SQLite connections [[@djmarcin]]
13+
* [[#1295]] Support custom initial options for SQLite [[@ghassmo]]
14+
* Allows specifying custom `PRAGMA`s and overriding those set by SQLx.
15+
* [[#1345]] Initial support for Postgres `COPY FROM/TO`[[@montanalow], [@abonander]]
16+
* [[#1439]] Handle multiple waiting results correctly in MySQL [[@eagletmt]]
17+
18+
[#1289]: https://github.com/launchbadge/sqlx/pull/1289
19+
[#1295]: https://github.com/launchbadge/sqlx/pull/1295
20+
[#1345]: https://github.com/launchbadge/sqlx/pull/1345
21+
[#1439]: https://github.com/launchbadge/sqlx/pull/1439
22+
[0.5.8-prs]: https://github.com/launchbadge/sqlx/pulls?q=is%3Apr+is%3Amerged+merged%3A2021-08-21..2021-10-01
23+
824
## 0.5.7 - 2021-08-20
925

1026
* [[#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
967983
[@marshoepial]: https://github.com/marshoepial
968984
[@link2ext]: https://github.com/link2ext
969985
[@madadam]: https://github.com/madadam
970-
[@AtkinsChang]: https://github.com/AtkinsChang
986+
[@AtkinsChang]: https://github.com/AtkinsChang
987+
[@djmarcin]: https://github.com/djmarcin
988+
[@ghassmo]: https://github.com/ghassmo
989+
[@eagletmt]: https://github.com/eagletmt
990+
[@montanalow]: https://github.com/montanalow

Cargo.lock

+5-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ members = [
1818

1919
[package]
2020
name = "sqlx"
21-
version = "0.5.7"
21+
version = "0.5.8"
2222
license = "MIT OR Apache-2.0"
2323
readme = "README.md"
2424
repository = "https://github.com/launchbadge/sqlx"

sqlx-cli/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "sqlx-cli"
3-
version = "0.5.7"
3+
version = "0.5.8"
44
description = "Command-line utility for SQLx, the Rust SQL toolkit."
55
edition = "2018"
66
readme = "README.md"

sqlx-core/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "sqlx-core"
3-
version = "0.5.7"
3+
version = "0.5.8"
44
repository = "https://github.com/launchbadge/sqlx"
55
description = "Core of SQLx, the rust SQL toolkit. Not intended to be used directly."
66
license = "MIT OR Apache-2.0"

sqlx-core/src/any/migrate.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,10 @@ impl Migrate for AnyConnection {
223223
AnyConnectionKind::MySql(conn) => conn.revert(migration),
224224

225225
#[cfg(feature = "mssql")]
226-
AnyConnectionKind::Mssql(_conn) => unimplemented!(),
226+
AnyConnectionKind::Mssql(_conn) => {
227+
let _ = migration;
228+
unimplemented!()
229+
}
227230
}
228231
}
229232
}

sqlx-core/src/postgres/copy.rs

+24-1
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,32 @@ impl<C: DerefMut<Target = PgConnection>> PgCopyIn<C> {
138138
})
139139
}
140140

141+
/// Returns `true` if Postgres is expecting data in text or CSV format.
142+
pub fn is_textual(&self) -> bool {
143+
self.response.format == 0
144+
}
145+
146+
/// Returns the number of columns expected in the input.
147+
pub fn num_columns(&self) -> usize {
148+
assert_eq!(
149+
self.response.num_columns as usize,
150+
self.response.format_codes.len(),
151+
"num_columns does not match format_codes.len()"
152+
);
153+
self.response.format_codes.len()
154+
}
155+
156+
/// Check if a column is expecting data in text format (`true`) or binary format (`false`).
157+
///
158+
/// ### Panics
159+
/// If `column` is out of range according to [`.num_columns()`][Self::num_columns].
160+
pub fn column_is_textual(&self, column: usize) -> bool {
161+
self.response.format_codes[column] == 0
162+
}
163+
141164
/// Send a chunk of `COPY` data.
142165
///
143-
/// If you're copying data from an `AsyncRead`, maybe consider [Self::copy_from] instead.
166+
/// If you're copying data from an `AsyncRead`, maybe consider [Self::read_from] instead.
144167
pub async fn send(&mut self, data: impl Deref<Target = [u8]>) -> Result<&mut Self> {
145168
self.conn
146169
.as_deref_mut()

sqlx-core/src/postgres/types/decimal.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ impl TryFrom<&'_ Decimal> for PgNumeric {
8888
type Error = BoxDynError;
8989

9090
fn try_from(decimal: &Decimal) -> Result<Self, BoxDynError> {
91-
if decimal.is_zero() {
91+
// `Decimal` added `is_zero()` as an inherent method in a more recent version
92+
if Zero::is_zero(decimal) {
9293
return Ok(PgNumeric::Number {
9394
sign: PgNumericSign::Positive,
9495
scale: 0,

sqlx-macros/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "sqlx-macros"
3-
version = "0.5.7"
3+
version = "0.5.8"
44
repository = "https://github.com/launchbadge/sqlx"
55
description = "Macros for SQLx, the rust SQL toolkit. Not intended to be used directly."
66
license = "MIT OR Apache-2.0"

sqlx-rt/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "sqlx-rt"
3-
version = "0.5.7"
3+
version = "0.5.8"
44
repository = "https://github.com/launchbadge/sqlx"
55
license = "MIT OR Apache-2.0"
66
description = "Runtime abstraction used by SQLx, the Rust SQL toolkit. Not intended to be used directly."

tests/postgres/postgres.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1148,7 +1148,7 @@ async fn it_can_abort_copy_in() -> anyhow::Result<()> {
11481148
)
11491149
.await?;
11501150

1151-
let mut copy = conn
1151+
let copy = conn
11521152
.copy_in_raw(
11531153
r#"
11541154
COPY users (id) FROM STDIN WITH (FORMAT CSV, HEADER);
@@ -1201,6 +1201,7 @@ async fn it_can_copy_out() -> anyhow::Result<()> {
12011201
Ok(())
12021202
}
12031203

1204+
#[sqlx_macros::test]
12041205
async fn test_issue_1254() -> anyhow::Result<()> {
12051206
#[derive(sqlx::Type)]
12061207
#[sqlx(type_name = "pair")]

tests/sqlite/derives.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use sqlx::Sqlite;
2-
use sqlx_test::{new, test_type};
2+
use sqlx_test::test_type;
33

44
#[derive(Debug, PartialEq, sqlx::Type)]
55
#[repr(u32)]

0 commit comments

Comments
 (0)