| 573 | #[derive(Debug, Serialize, Deserialize)] |
| 574 | #[serde(untagged)] |
| 575 | pub enum SqlResult { |
| 576 | /// The query returned rows. |
| 577 | Rows { |
| 578 | /// The command complete tag. |
| 579 | tag: String, |
| 580 | /// The result rows. |
| 581 | rows: Vec<Vec<serde_json::Value>>, |
| 582 | /// Information about each column. |
| 583 | desc: Description, |
| 584 | // Any notices generated during execution of the query. |
| 585 | notices: Vec<Notice>, |
| 586 | }, |
| 587 | /// The query executed successfully but did not return rows. |
| 588 | Ok { |
| 589 | /// The command complete tag. |
| 590 | ok: String, |
| 591 | /// Any notices generated during execution of the query. |
| 592 | notices: Vec<Notice>, |
| 593 | /// Any parameters that may have changed. |
| 594 | /// |
| 595 | /// Note: skip serializing this field in a response if the list of parameters is empty. |
| 596 | #[serde(skip_serializing_if = "Vec::is_empty")] |
| 597 | parameters: Vec<ParameterStatus>, |
| 598 | }, |
| 599 | /// The query returned an error. |
| 600 | Err { |
| 601 | error: SqlError, |
| 602 | // Any notices generated during execution of the query. |
| 603 | notices: Vec<Notice>, |
| 604 | }, |
| 605 | } |
| 606 | |
| 607 | impl SqlResult { |
| 608 | /// Convert adapter Row results into the web row result format. Error if the row format does not |
no outgoing calls
no test coverage detected