Parse a SQL string that must contain exactly one statement. Returns `Err(())` if parsing fails or the string contains zero or multiple statements.
(sql: &str)
| 1078 | /// Returns `Err(())` if parsing fails or the string contains zero or |
| 1079 | /// multiple statements. |
| 1080 | fn parse_one_statement(sql: &str) -> Result<Statement<Raw>, ()> { |
| 1081 | let mut statements = parse_sql(sql)?; |
| 1082 | if statements.len() != 1 { |
| 1083 | return Err(()); |
| 1084 | } |
| 1085 | Ok(statements.remove(0)) |
| 1086 | } |
| 1087 | |
| 1088 | /// Parse a list of SQL strings and downcast each to a specific statement type. |
| 1089 | /// |
no test coverage detected