fix: quote ident on rendered SQL (#2248)

* fix: quote ident on rendered SQL

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* read quote style from query context

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* update sqlness result

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

---------

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
This commit is contained in:
Ruihang Xia
2023-08-25 02:25:21 -05:00
committed by GitHub
parent de1daec680
commit 8d446ed741
10 changed files with 154 additions and 113 deletions

View File

@@ -57,7 +57,7 @@ pub enum Error {
UnsupportedDefaultValue { column_name: String, expr: Expr },
// Syntax error from sql parser.
#[snafu(display("Syntax error, sql: {}, source: {}", sql, source))]
#[snafu(display("Syntax error, source: {}, sql: {}", source, sql))]
Syntax { sql: String, source: ParserError },
#[snafu(display("Missing time index constraint"))]

View File

@@ -130,6 +130,15 @@ pub struct Partitions {
pub entries: Vec<PartitionEntry>,
}
impl Partitions {
/// set quotes to all [Ident]s from column list
pub fn set_quote(&mut self, quote_style: char) {
self.column_list
.iter_mut()
.for_each(|c| c.quote_style = Some(quote_style));
}
}
#[derive(Debug, PartialEq, Eq, Clone)]
pub struct PartitionEntry {
pub name: Ident,