Skip to content

Commit f8de9be

Browse files
committed
add suport for tz-aware datetimes in any
1 parent 54b04ff commit f8de9be

File tree

11 files changed

+51
-18
lines changed

11 files changed

+51
-18
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ 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.6.34
9+
10+
- Add support for decoding `DateTime<FixedOffset>` in the `Any` driver
11+
812
## 0.6.33
913

1014
- Add support for decoding all numeric types as either f32 or f64 in mssql.

Cargo.lock

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ members = [
2020

2121
[package]
2222
name = "sqlx-oldapi"
23-
version = "0.6.33"
23+
version = "0.6.34"
2424
license = "MIT OR Apache-2.0"
2525
readme = "README.md"
2626
repository = "https://github.com/lovasoa/sqlx"
@@ -125,8 +125,8 @@ bstr = ["sqlx-core/bstr"]
125125
git2 = ["sqlx-core/git2"]
126126

127127
[dependencies]
128-
sqlx-core = { package = "sqlx-core-oldapi", version = "0.6.33", path = "sqlx-core", default-features = false }
129-
sqlx-macros = { package = "sqlx-macros-oldapi", version = "0.6.33", path = "sqlx-macros", default-features = false, optional = true }
128+
sqlx-core = { package = "sqlx-core-oldapi", version = "0.6.34", path = "sqlx-core", default-features = false }
129+
sqlx-macros = { package = "sqlx-macros-oldapi", version = "0.6.34", path = "sqlx-macros", default-features = false, optional = true }
130130

131131
[dev-dependencies]
132132
anyhow = "1.0.52"

examples/postgres/axum-social-with-tests/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ edition = "2021"
88
[dependencies]
99
# Primary crates
1010
axum = { version = "0.5.13", features = ["macros"] }
11-
sqlx = { package = "sqlx-oldapi", version = "0.6.33", path = "../../../", features = ["runtime-tokio-rustls", "postgres", "time", "uuid"] }
11+
sqlx = { package = "sqlx-oldapi", version = "0.6.34", path = "../../../", features = ["runtime-tokio-rustls", "postgres", "time", "uuid"] }
1212
tokio = { version = "1.20.1", features = ["rt-multi-thread", "macros"] }
1313

1414
# Important secondary crates

sqlx-cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "sqlx-cli"
3-
version = "0.6.33"
3+
version = "0.6.34"
44
description = "Command-line utility for SQLx, the Rust SQL toolkit."
55
edition = "2021"
66
readme = "README.md"

sqlx-core/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "sqlx-core-oldapi"
3-
version = "0.6.33"
3+
version = "0.6.34"
44
repository = "https://github.com/lovasoa/sqlx"
55
description = "Core of SQLx, the rust SQL toolkit. Not intended to be used directly."
66
license = "MIT OR Apache-2.0"
@@ -101,7 +101,7 @@ offline = ["serde", "either/serde"]
101101
paste = "1.0.6"
102102
ahash = "0.8.3"
103103
atoi = "2.0.0"
104-
sqlx-rt = { path = "../sqlx-rt", version = "0.6.33", package = "sqlx-rt-oldapi" }
104+
sqlx-rt = { path = "../sqlx-rt", version = "0.6.34", package = "sqlx-rt-oldapi" }
105105
base64 = { version = "0.22", default-features = false, optional = true, features = ["std"] }
106106
bigdecimal_ = { version = "0.4.1", optional = true, package = "bigdecimal" }
107107
rust_decimal = { version = "1.19.0", optional = true }

sqlx-core/src/any/types.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ impl_any_type!(chrono::NaiveDateTime);
8484
#[cfg(feature = "chrono")]
8585
impl_any_type!(chrono::DateTime<chrono::offset::Utc>);
8686
#[cfg(feature = "chrono")]
87+
impl_any_type!(chrono::DateTime<chrono::offset::FixedOffset>);
88+
#[cfg(feature = "chrono")]
8789
impl_any_type!(chrono::DateTime<chrono::offset::Local>);
8890

8991
// Encode
@@ -96,6 +98,8 @@ impl_any_encode!(chrono::NaiveDateTime);
9698
#[cfg(feature = "chrono")]
9799
impl_any_encode!(chrono::DateTime<chrono::offset::Utc>);
98100
#[cfg(feature = "chrono")]
101+
impl_any_encode!(chrono::DateTime<chrono::offset::FixedOffset>);
102+
#[cfg(feature = "chrono")]
99103
impl_any_encode!(chrono::DateTime<chrono::offset::Local>);
100104

101105
// Decode
@@ -108,6 +112,8 @@ impl_any_decode!(chrono::NaiveDateTime);
108112
#[cfg(feature = "chrono")]
109113
impl_any_decode!(chrono::DateTime<chrono::offset::Utc>);
110114
#[cfg(feature = "chrono")]
115+
impl_any_decode!(chrono::DateTime<chrono::offset::FixedOffset>);
116+
#[cfg(feature = "chrono")]
111117
impl_any_decode!(chrono::DateTime<chrono::offset::Local>);
112118

113119
#[cfg(feature = "json")]

sqlx-macros/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "sqlx-macros-oldapi"
3-
version = "0.6.33"
3+
version = "0.6.34"
44
repository = "https://github.com/lovasoa/sqlx"
55
description = "Macros for SQLx, the rust SQL toolkit. Not intended to be used directly."
66
license = "MIT OR Apache-2.0"
@@ -75,8 +75,8 @@ heck = { version = "0.5" }
7575
either = "1.6.1"
7676
once_cell = "1.9.0"
7777
proc-macro2 = { version = "1.0.36", default-features = false }
78-
sqlx-core = { package = "sqlx-core-oldapi", version = "0.6.33", default-features = false, features = ["any"], path = "../sqlx-core" }
79-
sqlx-rt = { version = "0.6.33", default-features = false, path = "../sqlx-rt", package = "sqlx-rt-oldapi" }
78+
sqlx-core = { package = "sqlx-core-oldapi", version = "0.6.34", default-features = false, features = ["any"], path = "../sqlx-core" }
79+
sqlx-rt = { version = "0.6.34", default-features = false, path = "../sqlx-rt", package = "sqlx-rt-oldapi" }
8080
serde = { version = "1.0.132", features = ["derive"], optional = true }
8181
serde_json = { version = "1.0.73", optional = true }
8282
sha2 = { version = "0.10.0", optional = true }

sqlx-rt/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "sqlx-rt-oldapi"
3-
version = "0.6.33"
3+
version = "0.6.34"
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."

test.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
2-
docker compose -f tests/docker-compose.yml run -d -p 5432:5432 --name postgres_16 postgres_16
2+
docker compose -f tests/docker-compose.yml run -it -p 5432:5432 --name postgres_16 postgres_16
33
DATABASE_URL="postgres://postgres@localhost:5432/sqlx?sslmode=verify-ca&sslrootcert=./tests/certs/ca.crt&sslcert=./tests/certs/client.crt&sslkey=./tests/keys/client.key" cargo test --features any,postgres,macros,all-types,runtime-actix-rustls --
44

5-
docker compose -f tests/docker-compose.yml run -d -p 1433:1433 --name mssql_2022 mssql_2022
5+
docker compose -f tests/docker-compose.yml run -it -p 1433:1433 --name mssql_2022 mssql_2022
66
DATABASE_URL='mssql://sa:Password123!@localhost/sqlx' cargo test --features any,mssql,macros,all-types,runtime-actix-rustls --

0 commit comments

Comments
 (0)