Skip to content

Commit

Permalink
fix(postgres): regression of launchbadge#1449
Browse files Browse the repository at this point in the history
```
error: error occurred while decoding column 0: data did not match any variant of untagged enum Explain at line 3 column 1
Error:    --> tests/postgres/macros.rs:103:15
    |
103 |     let row = sqlx::query!(r#"CALL forty_two(null)"#)
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: this error originates in the macro `$crate::sqlx_macros::expand_query` which comes from the expansion of the macro `sqlx::query` (in Nightly builds, run with -Z macro-backtrace for more info)

error: could not compile `sqlx` (test "postgres-macros") due to previous error
```
  • Loading branch information
mrl5 committed Jul 17, 2023
1 parent 1d82d6f commit 175ba3f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions sqlx-postgres/src/connection/describe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -494,8 +494,7 @@ enum Explain {
QueryPlan(QueryPlan),
/// The string "Utility Statement" -- returned for
/// a CALL statement
#[serde(rename = "Utility Statement")]
UtilityStatement,
UtilityStatement(UtilityStatement),
}

#[derive(serde::Deserialize)]
Expand All @@ -509,6 +508,12 @@ struct QueryPlan {
_query_identifier: Option<u64>,
}

#[derive(serde::Deserialize)]
struct UtilityStatement {
#[serde(rename = "Utility Statement")]
_utility_statement: String,
}

#[derive(serde::Deserialize)]
struct Plan {
#[serde(rename = "Join Type")]
Expand Down

0 comments on commit 175ba3f

Please sign in to comment.