use crate::dialect::Dialect;
use core::iter::Peekable;
use core::str::Chars;
use super::PostgreSqlDialect;
#[derive(Debug)]
pub struct RedshiftSqlDialect {}
impl Dialect for RedshiftSqlDialect {
fn is_delimited_identifier_start(&self, ch: char) -> bool {
ch == '"' || ch == '['
}
fn is_proper_identifier_inside_quotes(&self, mut chars: Peekable<Chars<'_>>) -> bool {
chars.next();
let mut not_white_chars = chars.skip_while(|ch| ch.is_whitespace()).peekable();
if let Some(&ch) = not_white_chars.peek() {
return self.is_identifier_start(ch);
}
false
}
fn is_identifier_start(&self, ch: char) -> bool {
PostgreSqlDialect {}.is_identifier_start(ch) || ch == '#'
}
fn is_identifier_part(&self, ch: char) -> bool {
PostgreSqlDialect {}.is_identifier_part(ch) || ch == '#'
}
}