You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just posting it here to let you know about bug in macro expansion. Basically, rust-analyzer reports expected string literal error for completely valid code. More information can be found here kyrias/sqlx-conditional-queries#18
rust-analyzer version: 0.3.2212 rustc version: rustc 1.83.0 (90b35a623 2024-11-26) editor or extension: VSCode 2024-12-11, 22:49:33 code snippet to reproduce:
#[derive(Debug)]structOutputType{id:i32,name:String,}asyncfnquery_conditional(db:&MySqlPool) -> Result<(), sqlx::Error>{let limit = Some(5);let rows:Vec<OutputType> = conditional_query_as!(OutputType,r#" select id, name from users {#limit} "#,
#limit = match limit {Some(_) => "limit {limit}",None => ""},).fetch_all(db).await?;for row in rows {debug!("-------------------");debug!("{}", row.id);debug!("{}", row.name);}Ok(())}
The text was updated successfully, but these errors were encountered:
Just posting it here to let you know about bug in macro expansion. Basically, rust-analyzer reports
expected string literal
error for completely valid code. More information can be found here kyrias/sqlx-conditional-queries#18rust-analyzer version: 0.3.2212
rustc version: rustc 1.83.0 (90b35a623 2024-11-26)
editor or extension: VSCode 2024-12-11, 22:49:33
code snippet to reproduce:
The text was updated successfully, but these errors were encountered: