Skip to content

Patched out forcing references in query arguments #3899

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions sqlx-macros-core/src/query/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pub fn quote_args<DB: DatabaseExt>(
let arg_expr = input.arg_exprs.iter().cloned().map(strip_wildcard);

let arg_bindings = quote! {
#(let #arg_name = &(#arg_expr);)*
#(let #arg_name = (#arg_expr);)*
};

let args_check = match info.parameters() {
Expand Down Expand Up @@ -113,7 +113,7 @@ pub fn quote_args<DB: DatabaseExt>(
let mut query_args = <#db_path as ::sqlx::database::Database>::Arguments::<'_>::default();
query_args.reserve(
#args_count,
0 #(+ ::sqlx::encode::Encode::<#db_path>::size_hint(#arg_name))*
0 #(+ ::sqlx::encode::Encode::<#db_path>::size_hint(&#arg_name))*
);
let query_args = ::core::result::Result::<_, ::sqlx::error::BoxDynError>::Ok(query_args)
#(.and_then(move |mut query_args| query_args.add(#arg_name).map(move |()| query_args) ))*;
Expand Down
Loading