Improve error passing in SQL parser

This commit is contained in:
Tobie Morgan Hitchcock 2022-01-16 20:31:50 +00:00
parent 8b28a8e5f2
commit b29db4d999
65 changed files with 112 additions and 76 deletions

View file

@ -1,7 +1,7 @@
use crate::sql::error::IResult;
use nom::branch::alt;
use nom::bytes::complete::tag;
use nom::combinator::map;
use nom::IResult;
use serde::{Deserialize, Serialize};
use std::fmt;

View file

@ -4,13 +4,13 @@ use crate::dbs::Runtime;
use crate::err::Error;
use crate::sql::comment::mightbespace;
use crate::sql::common::commas;
use crate::sql::error::IResult;
use crate::sql::number::Number;
use crate::sql::strand::Strand;
use crate::sql::value::{value, Value};
use nom::bytes::complete::tag;
use nom::combinator::opt;
use nom::multi::separated_list0;
use nom::IResult;
use serde::ser::SerializeStruct;
use serde::{Deserialize, Serialize};
use std::fmt;

View file

@ -1,7 +1,7 @@
use crate::sql::error::IResult;
use nom::branch::alt;
use nom::bytes::complete::tag_no_case;
use nom::combinator::map;
use nom::IResult;
use serde::{Deserialize, Serialize};
use std::fmt;

View file

@ -1,3 +1,4 @@
use crate::sql::error::IResult;
use nom::branch::alt;
use nom::bytes::complete::tag;
use nom::bytes::complete::take_until;
@ -5,7 +6,6 @@ use nom::character::complete::multispace0;
use nom::character::complete::multispace1;
use nom::character::complete::not_line_ending;
use nom::multi::many1;
use nom::IResult;
pub fn mightbespace(i: &str) -> IResult<&str, ()> {
let (i, _) = alt((comment, blank))(i)?;

View file

@ -1,13 +1,13 @@
use crate::sql::comment::mightbespace;
use crate::sql::error::Error::ParserError;
use crate::sql::error::IResult;
use nom::bytes::complete::tag;
use nom::bytes::complete::take_while;
use nom::bytes::complete::take_while_m_n;
use nom::character::is_alphanumeric;
use nom::combinator::map;
use nom::error::Error;
use nom::error::ErrorKind;
use nom::multi::many1;
use nom::IResult;
use nom::Err::Error;
use std::ops::RangeBounds;
use std::str;
@ -76,6 +76,6 @@ pub fn take_digits_range(i: &str, n: usize, range: impl RangeBounds<u32>) -> IRe
if range.contains(&v) {
Ok((i, v))
} else {
Err(nom::Err::Error(Error::new(i, ErrorKind::Eof)))
Err(Error(ParserError(i)))
}
}

View file

@ -1,7 +1,7 @@
use crate::sql::comment::shouldbespace;
use crate::sql::error::IResult;
use crate::sql::value::{value, Value};
use nom::bytes::complete::tag_no_case;
use nom::IResult;
use serde::{Deserialize, Serialize};
use std::fmt;

View file

@ -2,6 +2,7 @@ use crate::sql::array::{array, Array};
use crate::sql::comment::mightbespace;
use crate::sql::comment::shouldbespace;
use crate::sql::common::commas;
use crate::sql::error::IResult;
use crate::sql::idiom::{idiom, Idiom};
use crate::sql::object::{object, Object};
use crate::sql::operator::{assigner, Operator};
@ -9,7 +10,6 @@ use crate::sql::value::{value, Value};
use nom::branch::alt;
use nom::bytes::complete::tag_no_case;
use nom::multi::separated_list1;
use nom::IResult;
use serde::{Deserialize, Serialize};
use std::fmt;

View file

@ -1,10 +1,10 @@
use crate::sql::common::{take_digits, take_digits_range, take_u32};
use crate::sql::error::IResult;
use chrono::{DateTime, FixedOffset, TimeZone, Utc};
use nom::branch::alt;
use nom::bytes::complete::tag;
use nom::combinator::map;
use nom::sequence::delimited;
use nom::IResult;
use serde::ser::SerializeStruct;
use serde::{Deserialize, Serialize};
use std::fmt;

View file

@ -1,9 +1,9 @@
use crate::sql::datetime::Datetime;
use crate::sql::error::IResult;
use chrono::DurationRound;
use nom::branch::alt;
use nom::bytes::complete::is_a;
use nom::bytes::complete::tag;
use nom::IResult;
use serde::ser::SerializeStruct;
use serde::{Deserialize, Serialize};
use std::fmt;

21
src/sql/error.rs Normal file
View file

@ -0,0 +1,21 @@
use nom::error::ErrorKind;
use nom::error::ParseError;
use nom::Err;
use thiserror::Error;
#[derive(Error, Debug)]
pub enum Error<I> {
ScriptError(String),
ParserError(I),
}
pub type IResult<I, O, E = Error<I>> = Result<(I, O), Err<E>>;
impl<I> ParseError<I> for Error<I> {
fn from_error_kind(input: I, _: ErrorKind) -> Self {
Error::ParserError(input)
}
fn append(_: I, _: ErrorKind, other: Self) -> Self {
other
}
}

View file

@ -3,9 +3,9 @@ use crate::dbs::Options;
use crate::dbs::Runtime;
use crate::err::Error;
use crate::fnc;
use crate::sql::error::IResult;
use crate::sql::operator::{operator, Operator};
use crate::sql::value::{single, value, Value};
use nom::IResult;
use serde::{Deserialize, Serialize};
use std::fmt;
use std::str;

View file

@ -1,9 +1,9 @@
use crate::sql::comment::shouldbespace;
use crate::sql::common::commas;
use crate::sql::error::IResult;
use crate::sql::idiom::{idiom, Idiom};
use nom::bytes::complete::tag_no_case;
use nom::multi::separated_list1;
use nom::IResult;
use serde::{Deserialize, Serialize};
use std::fmt;

View file

@ -1,11 +1,11 @@
use crate::sql::comment::shouldbespace;
use crate::sql::common::commas;
use crate::sql::error::IResult;
use crate::sql::idiom::{idiom, Idiom};
use crate::sql::value::{value, Value};
use nom::branch::alt;
use nom::bytes::complete::tag_no_case;
use nom::multi::separated_list1;
use nom::IResult;
use serde::{Deserialize, Serialize};
use std::fmt;

View file

@ -5,12 +5,12 @@ use crate::err::Error;
use crate::fnc;
use crate::sql::comment::mightbespace;
use crate::sql::common::commas;
use crate::sql::error::IResult;
use crate::sql::script::{script, Script};
use crate::sql::value::{single, value, Value};
use nom::branch::alt;
use nom::bytes::complete::tag;
use nom::multi::separated_list0;
use nom::IResult;
use serde::{Deserialize, Serialize};
use std::cmp::Ordering;
use std::fmt;

View file

@ -1,5 +1,6 @@
use crate::sql::comment::mightbespace;
use crate::sql::common::commas;
use crate::sql::error::IResult;
use geo::algorithm::contains::Contains;
use geo::algorithm::intersects::Intersects;
use geo::{LineString, Point, Polygon};
@ -11,7 +12,6 @@ use nom::multi::separated_list1;
use nom::number::complete::double;
use nom::sequence::delimited;
use nom::sequence::preceded;
use nom::IResult;
use serde::ser::SerializeMap;
use serde::{Deserialize, Serialize};
use std::cmp::Ordering;

View file

@ -1,5 +1,6 @@
use crate::sql::comment::mightbespace;
use crate::sql::comment::shouldbespace;
use crate::sql::error::IResult;
use crate::sql::idiom::{idiom, Idiom};
use crate::sql::table::{tables, Tables};
use crate::sql::value::{value, Value};
@ -7,7 +8,6 @@ use nom::branch::alt;
use nom::bytes::complete::tag;
use nom::bytes::complete::tag_no_case;
use nom::combinator::opt;
use nom::IResult;
use serde::{Deserialize, Serialize};
use std::fmt;

View file

@ -1,11 +1,11 @@
use crate::sql::comment::shouldbespace;
use crate::sql::common::commas;
use crate::sql::error::IResult;
use crate::sql::idiom::{idiom, Idiom};
use nom::bytes::complete::tag_no_case;
use nom::combinator::opt;
use nom::multi::separated_list1;
use nom::sequence::tuple;
use nom::IResult;
use serde::{Deserialize, Serialize};
use std::fmt;

View file

@ -1,11 +1,11 @@
use crate::sql::common::escape;
use crate::sql::common::val_char;
use crate::sql::error::IResult;
use nom::branch::alt;
use nom::bytes::complete::is_not;
use nom::bytes::complete::tag;
use nom::bytes::complete::take_while1;
use nom::sequence::delimited;
use nom::IResult;
use serde::{Deserialize, Serialize};
use std::fmt;
use std::str;

View file

@ -3,12 +3,12 @@ use crate::dbs::Options;
use crate::dbs::Runtime;
use crate::err::Error;
use crate::sql::common::commas;
use crate::sql::error::IResult;
use crate::sql::part::{all, field, first, graph, index, part, Part};
use crate::sql::value::Value;
use nom::branch::alt;
use nom::multi::many0;
use nom::multi::separated_list1;
use nom::IResult;
use serde::{Deserialize, Serialize};
use std::fmt;
use std::str;

View file

@ -1,9 +1,9 @@
use crate::sql::error::IResult;
use crate::sql::table::{table, Table};
use nom::branch::alt;
use nom::bytes::complete::tag;
use nom::combinator::map;
use nom::multi::many1;
use nom::IResult;
use serde::{Deserialize, Serialize};
use std::fmt;

View file

@ -1,9 +1,9 @@
use crate::sql::comment::shouldbespace;
use crate::sql::common::take_u64;
use crate::sql::error::IResult;
use nom::bytes::complete::tag_no_case;
use nom::combinator::opt;
use nom::sequence::tuple;
use nom::IResult;
use serde::{Deserialize, Serialize};
use std::fmt;

View file

@ -9,6 +9,7 @@ pub mod cond;
pub mod data;
pub mod datetime;
pub mod duration;
pub mod error;
pub mod expression;
pub mod fetch;
pub mod field;

View file

@ -1,10 +1,10 @@
use crate::sql::common::escape;
use crate::sql::common::take_u64;
use crate::sql::common::val_char;
use crate::sql::error::IResult;
use crate::sql::ident::ident_raw;
use nom::branch::alt;
use nom::bytes::complete::tag;
use nom::IResult;
use serde::{Deserialize, Serialize};
use std::fmt;

View file

@ -1,9 +1,9 @@
use crate::sql::error::IResult;
use dec::prelude::FromPrimitive;
use dec::prelude::ToPrimitive;
use dec::Decimal;
use dec::MathematicalOps;
use nom::number::complete::double;
use nom::IResult;
use serde::{Deserialize, Serialize};
use std::cmp::Ordering;
use std::fmt;

View file

@ -4,6 +4,7 @@ use crate::dbs::Runtime;
use crate::err::Error;
use crate::sql::comment::mightbespace;
use crate::sql::common::{commas, escape, val_char};
use crate::sql::error::IResult;
use crate::sql::value::{value, Value};
use nom::branch::alt;
use nom::bytes::complete::is_not;
@ -12,7 +13,6 @@ use nom::bytes::complete::take_while1;
use nom::combinator::opt;
use nom::multi::separated_list0;
use nom::sequence::delimited;
use nom::IResult;
use serde::ser::SerializeMap;
use serde::ser::SerializeStruct;
use serde::{Deserialize, Serialize};

View file

@ -1,10 +1,10 @@
use crate::sql::comment::mightbespace;
use crate::sql::comment::shouldbespace;
use crate::sql::error::IResult;
use nom::branch::alt;
use nom::bytes::complete::tag;
use nom::bytes::complete::tag_no_case;
use nom::combinator::map;
use nom::IResult;
use serde::{Deserialize, Serialize};
use std::fmt;

View file

@ -1,12 +1,12 @@
use crate::sql::comment::shouldbespace;
use crate::sql::common::commas;
use crate::sql::error::IResult;
use crate::sql::idiom::{idiom, Idiom};
use nom::branch::alt;
use nom::bytes::complete::tag_no_case;
use nom::combinator::{map, opt};
use nom::multi::separated_list1;
use nom::sequence::tuple;
use nom::IResult;
use serde::{Deserialize, Serialize};
use std::fmt;

View file

@ -1,9 +1,9 @@
use crate::sql::comment::shouldbespace;
use crate::sql::error::IResult;
use crate::sql::field::{fields, Fields};
use nom::branch::alt;
use nom::bytes::complete::tag_no_case;
use nom::combinator::map;
use nom::IResult;
use serde::{Deserialize, Serialize};
use std::fmt;

View file

@ -2,12 +2,12 @@ use crate::dbs::Executor;
use crate::dbs::Options;
use crate::dbs::Runtime;
use crate::err::Error;
use crate::sql::error::IResult;
use crate::sql::idiom;
use crate::sql::idiom::Idiom;
use crate::sql::part::Part;
use crate::sql::value::Value;
use nom::bytes::complete::tag;
use nom::IResult;
use serde::{Deserialize, Serialize};
use std::fmt;
use std::str;

View file

@ -1,4 +1,6 @@
use crate::err::Error;
use crate::sql::error::Error::ParserError;
use crate::sql::error::Error::ScriptError;
use crate::sql::query::{query, Query};
use nom::Err;
use std::str;
@ -8,21 +10,31 @@ pub fn parse(input: &str) -> Result<Query, Error> {
0 => Err(Error::EmptyError),
_ => match query(input) {
Ok((_, query)) => Ok(query),
Err(Err::Error(e)) => match locate(input, e.input) {
(s, l, c) => Err(Error::ParseError {
line: l,
char: c,
sql: s.to_string(),
Err(Err::Error(e)) => match e {
ParserError(e) => match locate(input, e) {
(s, l, c) => Err(Error::ParseError {
line: l,
char: c,
sql: s.to_string(),
}),
},
ScriptError(e) => Err(Error::LanguageError {
message: e,
}),
},
Err(Err::Failure(e)) => match locate(input, e.input) {
(s, l, c) => Err(Error::ParseError {
line: l,
char: c,
sql: s.to_string(),
Err(Err::Failure(e)) => match e {
ParserError(e) => match locate(input, e) {
(s, l, c) => Err(Error::ParseError {
line: l,
char: c,
sql: s.to_string(),
}),
},
ScriptError(e) => Err(Error::LanguageError {
message: e,
}),
},
Err(Err::Incomplete(_)) => Err(Error::EmptyError),
_ => unreachable!(),
},
}
}

View file

@ -1,4 +1,5 @@
use crate::sql::comment::shouldbespace;
use crate::sql::error::IResult;
use crate::sql::graph::{graph as graph_raw, Graph};
use crate::sql::ident::{ident, Ident};
use crate::sql::number::{number, Number};
@ -6,7 +7,6 @@ use crate::sql::value::{value, Value};
use nom::branch::alt;
use nom::bytes::complete::tag;
use nom::bytes::complete::tag_no_case;
use nom::IResult;
use serde::{Deserialize, Serialize};
use std::fmt;
use std::str;

View file

@ -1,10 +1,11 @@
use crate::sql::comment::shouldbespace;
use crate::sql::common::commas;
use crate::sql::error::IResult;
use crate::sql::value::{value, Value};
use nom::branch::alt;
use nom::bytes::complete::tag_no_case;
use nom::combinator::map;
use nom::{multi::separated_list0, sequence::tuple, IResult};
use nom::{multi::separated_list0, sequence::tuple};
use serde::{Deserialize, Serialize};
use std::fmt;
use std::str;

View file

@ -1,6 +1,6 @@
use crate::sql::error::IResult;
use crate::sql::statement::{statements, Statement, Statements};
use nom::combinator::all_consuming;
use nom::IResult;
use serde::{Deserialize, Serialize};
use std::fmt;
use std::str;

View file

@ -1,8 +1,8 @@
use crate::sql::error::IResult;
use nom::bytes::complete::escaped;
use nom::bytes::complete::is_not;
use nom::bytes::complete::tag;
use nom::character::complete::one_of;
use nom::IResult;
use serde::{Deserialize, Serialize};
use std::cmp::Ordering;
use std::fmt;

View file

@ -1,9 +1,9 @@
use crate::sql::error::IResult;
use nom::branch::alt;
use nom::bytes::complete::escaped;
use nom::bytes::complete::is_not;
use nom::bytes::complete::tag;
use nom::character::complete::one_of;
use nom::IResult;
use serde::{Deserialize, Serialize};
use std::fmt;
use std::str;

View file

@ -1,11 +1,11 @@
use crate::sql::comment::shouldbespace;
use crate::sql::common::commas;
use crate::sql::error::IResult;
use crate::sql::idiom::{idiom, Idiom};
use nom::bytes::complete::tag_no_case;
use nom::combinator::opt;
use nom::multi::separated_list1;
use nom::sequence::tuple;
use nom::IResult;
use serde::{Deserialize, Serialize};
use std::fmt;

View file

@ -1,9 +1,9 @@
use crate::sql::comment::shouldbespace;
use crate::sql::common::take_u64;
use crate::sql::error::IResult;
use nom::bytes::complete::tag_no_case;
use nom::combinator::opt;
use nom::sequence::tuple;
use nom::IResult;
use serde::{Deserialize, Serialize};
use std::fmt;

View file

@ -4,6 +4,7 @@ use crate::dbs::Runtime;
use crate::err::Error;
use crate::sql::comment::{comment, mightbespace};
use crate::sql::common::colons;
use crate::sql::error::IResult;
use crate::sql::statements::begin::{begin, BeginStatement};
use crate::sql::statements::cancel::{cancel, CancelStatement};
use crate::sql::statements::commit::{commit, CommitStatement};
@ -29,7 +30,6 @@ use nom::combinator::map;
use nom::multi::many0;
use nom::multi::separated_list1;
use nom::sequence::delimited;
use nom::IResult;
use serde::{Deserialize, Serialize};
use std::fmt;
use std::time::Duration;

View file

@ -3,12 +3,12 @@ use crate::dbs::Options;
use crate::dbs::Runtime;
use crate::err::Error;
use crate::sql::comment::shouldbespace;
use crate::sql::error::IResult;
use crate::sql::value::Value;
use nom::branch::alt;
use nom::bytes::complete::tag_no_case;
use nom::combinator::opt;
use nom::sequence::tuple;
use nom::IResult;
use serde::{Deserialize, Serialize};
use std::fmt;

View file

@ -3,12 +3,12 @@ use crate::dbs::Options;
use crate::dbs::Runtime;
use crate::err::Error;
use crate::sql::comment::shouldbespace;
use crate::sql::error::IResult;
use crate::sql::value::Value;
use nom::branch::alt;
use nom::bytes::complete::tag_no_case;
use nom::combinator::opt;
use nom::sequence::tuple;
use nom::IResult;
use serde::{Deserialize, Serialize};
use std::fmt;

View file

@ -3,12 +3,12 @@ use crate::dbs::Options;
use crate::dbs::Runtime;
use crate::err::Error;
use crate::sql::comment::shouldbespace;
use crate::sql::error::IResult;
use crate::sql::value::Value;
use nom::branch::alt;
use nom::bytes::complete::tag_no_case;
use nom::combinator::opt;
use nom::sequence::tuple;
use nom::IResult;
use serde::{Deserialize, Serialize};
use std::fmt;

View file

@ -6,13 +6,13 @@ use crate::dbs::Runtime;
use crate::err::Error;
use crate::sql::comment::shouldbespace;
use crate::sql::data::{data, Data};
use crate::sql::error::IResult;
use crate::sql::output::{output, Output};
use crate::sql::timeout::{timeout, Timeout};
use crate::sql::value::{whats, Value, Values};
use nom::bytes::complete::tag_no_case;
use nom::combinator::opt;
use nom::sequence::preceded;
use nom::IResult;
use serde::{Deserialize, Serialize};
use std::fmt;

View file

@ -8,6 +8,7 @@ use crate::sql::base::{base, Base};
use crate::sql::comment::shouldbespace;
use crate::sql::common::take_u64;
use crate::sql::duration::{duration, Duration};
use crate::sql::error::IResult;
use crate::sql::ident::ident_raw;
use crate::sql::idiom;
use crate::sql::idiom::{Idiom, Idioms};
@ -19,8 +20,8 @@ use crate::sql::view::{view, View};
use nom::branch::alt;
use nom::bytes::complete::tag_no_case;
use nom::combinator::{map, opt};
use nom::multi::many0;
use nom::sequence::tuple;
use nom::{multi::many0, IResult};
use serde::{Deserialize, Serialize};
use std::fmt;

View file

@ -6,6 +6,7 @@ use crate::dbs::Runtime;
use crate::err::Error;
use crate::sql::comment::shouldbespace;
use crate::sql::cond::{cond, Cond};
use crate::sql::error::IResult;
use crate::sql::output::{output, Output};
use crate::sql::timeout::{timeout, Timeout};
use crate::sql::value::{whats, Value, Values};
@ -13,7 +14,6 @@ use nom::bytes::complete::tag_no_case;
use nom::combinator::opt;
use nom::sequence::preceded;
use nom::sequence::tuple;
use nom::IResult;
use serde::{Deserialize, Serialize};
use std::fmt;

View file

@ -3,11 +3,11 @@ use crate::dbs::Options;
use crate::dbs::Runtime;
use crate::err::Error;
use crate::sql::comment::shouldbespace;
use crate::sql::error::IResult;
use crate::sql::value::{value, Value};
use nom::bytes::complete::tag_no_case;
use nom::combinator::opt;
use nom::multi::separated_list0;
use nom::IResult;
use serde::{Deserialize, Serialize};
use std::fmt;

View file

@ -4,11 +4,11 @@ use crate::dbs::Options;
use crate::dbs::Runtime;
use crate::err::Error;
use crate::sql::comment::shouldbespace;
use crate::sql::error::IResult;
use crate::sql::ident::ident_raw;
use crate::sql::value::Value;
use nom::branch::alt;
use nom::bytes::complete::tag_no_case;
use nom::IResult;
use serde::{Deserialize, Serialize};
use std::fmt;

View file

@ -6,6 +6,7 @@ use crate::dbs::Runtime;
use crate::err::Error;
use crate::sql::comment::shouldbespace;
use crate::sql::data::{single, update, values, Data};
use crate::sql::error::IResult;
use crate::sql::output::{output, Output};
use crate::sql::table::{table, Table};
use crate::sql::timeout::{timeout, Timeout};
@ -14,7 +15,6 @@ use nom::branch::alt;
use nom::bytes::complete::tag_no_case;
use nom::combinator::opt;
use nom::sequence::preceded;
use nom::IResult;
use serde::{Deserialize, Serialize};
use std::fmt;

View file

@ -3,10 +3,10 @@ use crate::dbs::Options;
use crate::dbs::Runtime;
use crate::err::Error;
use crate::sql::comment::shouldbespace;
use crate::sql::error::IResult;
use crate::sql::ident::{ident, Ident};
use crate::sql::value::Value;
use nom::bytes::complete::tag_no_case;
use nom::IResult;
use serde::{Deserialize, Serialize};
use std::fmt;

View file

@ -4,6 +4,7 @@ use crate::dbs::Runtime;
use crate::err::Error;
use crate::sql::comment::shouldbespace;
use crate::sql::cond::{cond, Cond};
use crate::sql::error::IResult;
use crate::sql::fetch::{fetch, Fetchs};
use crate::sql::field::{fields, Fields};
use crate::sql::value::Value;
@ -11,7 +12,6 @@ use crate::sql::value::{whats, Values};
use nom::bytes::complete::tag_no_case;
use nom::combinator::opt;
use nom::sequence::preceded;
use nom::IResult;
use serde::{Deserialize, Serialize};
use std::fmt;

View file

@ -5,6 +5,7 @@ use crate::dbs::Runtime;
use crate::err::Error;
use crate::sql::comment::mightbespace;
use crate::sql::comment::shouldbespace;
use crate::sql::error::IResult;
use crate::sql::ident::{ident, Ident};
use crate::sql::value::Value;
use nom::branch::alt;
@ -12,7 +13,6 @@ use nom::bytes::complete::tag;
use nom::bytes::complete::tag_no_case;
use nom::combinator::{map, opt};
use nom::sequence::tuple;
use nom::IResult;
use serde::{Deserialize, Serialize};
use std::fmt;

View file

@ -3,9 +3,9 @@ use crate::dbs::Options;
use crate::dbs::Runtime;
use crate::err::Error;
use crate::sql::comment::shouldbespace;
use crate::sql::error::IResult;
use crate::sql::value::{value, Value};
use nom::bytes::complete::tag_no_case;
use nom::IResult;
use serde::{Deserialize, Serialize};
use std::fmt;

View file

@ -7,6 +7,7 @@ use crate::err::Error;
use crate::sql::comment::mightbespace;
use crate::sql::comment::shouldbespace;
use crate::sql::data::{data, Data};
use crate::sql::error::IResult;
use crate::sql::output::{output, Output};
use crate::sql::table::{table, Table};
use crate::sql::timeout::{timeout, Timeout};
@ -16,7 +17,6 @@ use nom::bytes::complete::tag;
use nom::bytes::complete::tag_no_case;
use nom::combinator::opt;
use nom::sequence::preceded;
use nom::IResult;
use serde::{Deserialize, Serialize};
use std::fmt;

View file

@ -5,13 +5,13 @@ use crate::dbs::Runtime;
use crate::err::Error;
use crate::sql::base::{base, Base};
use crate::sql::comment::shouldbespace;
use crate::sql::error::IResult;
use crate::sql::ident::ident_raw;
use crate::sql::value::Value;
use nom::branch::alt;
use nom::bytes::complete::tag_no_case;
use nom::combinator::{map, opt};
use nom::sequence::tuple;
use nom::IResult;
use serde::{Deserialize, Serialize};
use std::fmt;

View file

@ -6,6 +6,7 @@ use crate::dbs::Runtime;
use crate::err::Error;
use crate::sql::comment::shouldbespace;
use crate::sql::cond::{cond, Cond};
use crate::sql::error::IResult;
use crate::sql::fetch::{fetch, Fetchs};
use crate::sql::field::{fields, Fields};
use crate::sql::group::{group, Groups};
@ -19,7 +20,6 @@ use crate::sql::version::{version, Version};
use nom::bytes::complete::tag_no_case;
use nom::combinator::opt;
use nom::sequence::preceded;
use nom::IResult;
use serde::{Deserialize, Serialize};
use std::fmt;

View file

@ -4,12 +4,12 @@ use crate::dbs::Runtime;
use crate::err::Error;
use crate::sql::comment::mightbespace;
use crate::sql::comment::shouldbespace;
use crate::sql::error::IResult;
use crate::sql::ident::ident_raw;
use crate::sql::value::{value, Value};
use nom::bytes::complete::tag;
use nom::bytes::complete::tag_no_case;
use nom::sequence::preceded;
use nom::IResult;
use serde::{Deserialize, Serialize};
use std::fmt;

View file

@ -7,13 +7,13 @@ use crate::err::Error;
use crate::sql::comment::shouldbespace;
use crate::sql::cond::{cond, Cond};
use crate::sql::data::{data, Data};
use crate::sql::error::IResult;
use crate::sql::output::{output, Output};
use crate::sql::timeout::{timeout, Timeout};
use crate::sql::value::{whats, Value, Values};
use nom::bytes::complete::tag_no_case;
use nom::combinator::opt;
use nom::sequence::preceded;
use nom::IResult;
use serde::{Deserialize, Serialize};
use std::fmt;

View file

@ -4,11 +4,11 @@ use crate::dbs::Options;
use crate::dbs::Runtime;
use crate::err::Error;
use crate::sql::comment::shouldbespace;
use crate::sql::error::IResult;
use crate::sql::ident::ident_raw;
use crate::sql::value::Value;
use nom::branch::alt;
use nom::bytes::complete::tag_no_case;
use nom::IResult;
use serde::{Deserialize, Serialize};
use std::fmt;

View file

@ -1,9 +1,9 @@
use crate::sql::error::IResult;
use nom::branch::alt;
use nom::bytes::complete::escaped;
use nom::bytes::complete::is_not;
use nom::bytes::complete::tag;
use nom::character::complete::one_of;
use nom::IResult;
use serde::ser::SerializeStruct;
use serde::{Deserialize, Serialize};
use std::fmt;

View file

@ -3,6 +3,7 @@ use crate::dbs::Executor;
use crate::dbs::Options;
use crate::dbs::Runtime;
use crate::err::Error;
use crate::sql::error::IResult;
use crate::sql::statements::create::{create, CreateStatement};
use crate::sql::statements::delete::{delete, DeleteStatement};
use crate::sql::statements::ifelse::{ifelse, IfelseStatement};
@ -14,7 +15,6 @@ use crate::sql::value::{value, Value};
use nom::branch::alt;
use nom::bytes::complete::tag;
use nom::combinator::map;
use nom::IResult;
use serde::{Deserialize, Serialize};
use std::cmp::Ordering;
use std::fmt;

View file

@ -1,9 +1,9 @@
use crate::sql::common::commas;
use crate::sql::common::escape;
use crate::sql::common::val_char;
use crate::sql::error::IResult;
use crate::sql::ident::ident_raw;
use nom::multi::separated_list1;
use nom::IResult;
use serde::{Deserialize, Serialize};
use std::fmt;
use std::str;

View file

@ -1,8 +1,8 @@
use crate::sql::common::escape;
use crate::sql::common::val_char;
use crate::sql::error::IResult;
use crate::sql::ident::ident_raw;
use nom::bytes::complete::tag;
use nom::IResult;
use serde::ser::SerializeStruct;
use serde::{Deserialize, Serialize};
use std::fmt;

View file

@ -1,7 +1,7 @@
use crate::sql::comment::shouldbespace;
use crate::sql::duration::{duration, Duration};
use crate::sql::error::IResult;
use nom::bytes::complete::tag_no_case;
use nom::IResult;
use serde::{Deserialize, Serialize};
use std::fmt;

View file

@ -6,6 +6,7 @@ use crate::sql::array::{array, Array};
use crate::sql::common::commas;
use crate::sql::datetime::{datetime, datetime_raw, Datetime};
use crate::sql::duration::{duration, duration_raw, Duration};
use crate::sql::error::IResult;
use crate::sql::expression::{expression, Expression};
use crate::sql::function::{function, Function};
use crate::sql::geometry::{geometry, Geometry};
@ -30,7 +31,6 @@ use nom::branch::alt;
use nom::bytes::complete::tag_no_case;
use nom::combinator::map;
use nom::multi::separated_list1;
use nom::IResult;
use once_cell::sync::Lazy;
use serde::{Deserialize, Serialize};
use std::collections::BTreeMap;

View file

@ -1,7 +1,7 @@
use crate::sql::comment::shouldbespace;
use crate::sql::datetime::{datetime, Datetime};
use crate::sql::error::IResult;
use nom::bytes::complete::tag_no_case;
use nom::IResult;
use serde::{Deserialize, Serialize};
use std::fmt;

View file

@ -1,12 +1,12 @@
use crate::sql::comment::shouldbespace;
use crate::sql::cond::{cond, Cond};
use crate::sql::error::IResult;
use crate::sql::field::{fields, Fields};
use crate::sql::group::{group, Groups};
use crate::sql::table::{tables, Tables};
use nom::bytes::complete::tag_no_case;
use nom::combinator::opt;
use nom::sequence::preceded;
use nom::IResult;
use serde::{Deserialize, Serialize};
use std::fmt;