cargo format

This commit is contained in:
Yuriy Dupyn 2024-01-28 22:40:41 +01:00
parent 4d45da0cd1
commit 845db102c2
33 changed files with 885 additions and 530 deletions

View file

@ -4,8 +4,8 @@ use nom::{
IResult,
};
use super::common::{parse_condition, parse_table_name};
use crate::syntax::RawQuerySyntax;
use super::common::{parse_table_name, parse_condition};
pub fn parse_delete(input: &str) -> IResult<&str, RawQuerySyntax> {
let (input, _) = tag("DELETE")(input)?;
@ -25,14 +25,15 @@ pub fn parse_delete(input: &str) -> IResult<&str, RawQuerySyntax> {
#[cfg(test)]
mod tests {
use crate::syntax::RawQuerySyntax;
use crate::parsing::delete::parse_delete;
use crate::syntax::RawQuerySyntax;
#[test]
fn test_parse_delete() {
let (_, operation) = parse_delete("DELETE FROM \"T1\" WHERE id = 1 ;").expect("should parse");
let (_, operation) =
parse_delete("DELETE FROM \"T1\" WHERE id = 1 ;").expect("should parse");
assert!(matches!(operation, RawQuerySyntax::Delete(_, _)))
}
// TODO: add test with condition
// TODO: add test with condition
}