Skip to content

Commit b8b01cc

Browse files
authored
Merge pull request #147 from WattSense/sync_wrapper_use_cache
Use owned row cache in sync wrapper
2 parents e1dbe14 + b03fabf commit b8b01cc

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

.github/workflows/ci.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -228,11 +228,11 @@ jobs:
228228
- name: Check formating
229229
run: cargo +stable fmt --all -- --check
230230
minimal_rust_version:
231-
name: Check Minimal supported rust version (1.65.0)
231+
name: Check Minimal supported rust version (1.78.0)
232232
runs-on: ubuntu-latest
233233
steps:
234234
- uses: actions/checkout@v4
235-
- uses: dtolnay/rust-toolchain@1.65.0
235+
- uses: dtolnay/rust-toolchain@1.78.0
236236
- uses: dtolnay/rust-toolchain@nightly
237237
- uses: taiki-e/install-action@cargo-hack
238238
- uses: taiki-e/install-action@cargo-minimal-versions
@@ -241,4 +241,4 @@ jobs:
241241
# has broken min-version dependencies
242242
# cannot test sqlite yet as that crate
243243
# as broken min-version dependencies as well
244-
run: cargo +stable minimal-versions check -p diesel-async --features "postgres bb8 deadpool mobc"
244+
run: cargo +1.78.0 minimal-versions check -p diesel-async --features "postgres bb8 deadpool mobc"

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ for Rust libraries in [RFC #1105](https://github.com/rust-lang/rfcs/blob/master/
88

99
* Added type `diesel_async::pooled_connection::mobc::PooledConnection`
1010
* MySQL/MariaDB now use `CLIENT_FOUND_ROWS` capability to allow consistent behavior with PostgreSQL regarding return value of UPDATe commands.
11+
* The minimal supported rust version is now 1.78.0
1112

1213
## [0.4.1] - 2023-09-01
1314

Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ repository = "https://github.com/weiznich/diesel_async"
1010
keywords = ["orm", "database", "sql", "async"]
1111
categories = ["database"]
1212
description = "An async extension for Diesel the safe, extensible ORM and Query Builder"
13-
rust-version = "1.65.0"
13+
rust-version = "1.78.0"
1414

1515
[dependencies]
1616
diesel = { version = "~2.1.1", default-features = false, features = [
@@ -95,4 +95,4 @@ members = [
9595
]
9696

9797
[patch.crates-io]
98-
diesel = { git = "http://github.com/diesel-rs/diesel", rev = "793de72" }
98+
diesel = { git = "http://github.com/diesel-rs/diesel", "rev" = "f2eb9b2"}

src/sync_connection_wrapper.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,11 @@ where
125125
{
126126
self.execute_with_prepared_query(source.as_query(), |conn, query| {
127127
use diesel::row::IntoOwnedRow;
128+
let mut cache = <<<C as LoadConnection>::Row<'_, '_> as IntoOwnedRow<
129+
<C as Connection>::Backend,
130+
>>::Cache as Default>::default();
128131
conn.load(&query).map(|c| {
129-
c.map(|row| row.map(IntoOwnedRow::into_owned))
132+
c.map(|row| row.map(|r| IntoOwnedRow::into_owned(r, &mut cache)))
130133
.collect::<Vec<QueryResult<O>>>()
131134
})
132135
})

0 commit comments

Comments
 (0)