We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
params
Pardon the possible dumb question, but is there a good reason for the difference between:
query_typed_raw:
params: I where P: BorrowToSql, I: IntoIterator<Item = (P, Type)>,
and query_typed:
params: &[(&(dyn ToSql + Sync), Type)],
I'm forced to have 2 different implems for passing the same values:
query_typed:
let p1 = serde_json::to_value(&query.params); let p2 = serde_json::to_value(&query); let sql_params: Vec<(&(dyn ToSql + Sync), Type)> = vec![ (p1.as_ref().map_err(internal_error)?, Type::JSONB), (p2.as_ref().map_err(internal_error)?, Type::JSONB), ]; let rows: Vec<String> = tx.query_typed(&query.sql, sql_params.as_slice()).await.map_err(internal_error)?;
let sql_params = vec![ (serde_json::to_value(&query.params).map_err(internal_error)?, Type::JSONB), (serde_json::to_value(&query).map_err(internal_error)?, Type::JSONB), ]; let rows = tx.query_typed_raw(&query.sql, sql_params).await.map_err(internal_error)?;
Am I doing something wrong? Thanks :)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Pardon the possible dumb question, but is there a good reason for the difference between:
query_typed_raw:
and query_typed:
I'm forced to have 2 different implems for passing the same values:
query_typed:
query_typed_raw:
Am I doing something wrong?
Thanks :)
The text was updated successfully, but these errors were encountered: