Skip to content

Commit 989950e

Browse files
authored
Merge pull request #17 from m-nawa/supress-deperecated-warning-when-not-use-fetch_many
Deprecated `fetch_many` method since it was deprecated in `sqlx` 0.7.4.
2 parents 5a95257 + 38d47ba commit 989950e

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Deprecated
11+
12+
- Deprecated `fetch_many` method since it was deprecated in `sqlx` 0.7.4. ([#17](https://github.com/kyrias/sqlx-conditional-queries/pull/17))
13+
1014

1115
## [0.1.3] - 2023-07-12
1216

core/src/codegen.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ fn build_conditional_map(variant_count: usize) -> proc_macro2::TokenStream {
9595
}
9696

9797
/// See [`sqlx::query::Map::fetch_many`]
98+
#[deprecated = "Only the SQLite driver supports multiple statements in one prepared statement and that behavior is deprecated. Use `sqlx::raw_sql()` instead. See https://github.com/launchbadge/sqlx/issues/3108 for discussion."]
9899
pub fn fetch_many<'e, 'c: 'e, E>(
99100
mut self,
100101
executor: E,
@@ -110,7 +111,10 @@ fn build_conditional_map(variant_count: usize) -> proc_macro2::TokenStream {
110111
{
111112
match self {
112113
#(
113-
Self::#variants(map) => map.fetch_many(executor),
114+
Self::#variants(map) => {
115+
#[allow(deprecated)]
116+
map.fetch_many(executor)
117+
}
114118
)*
115119
}
116120
}

0 commit comments

Comments
 (0)