File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -44,10 +44,12 @@ impl Dialect for RedshiftSqlDialect {
44
44
}
45
45
46
46
fn is_identifier_start ( & self , ch : char ) -> bool {
47
- PostgreSqlDialect { } . is_identifier_start ( ch)
47
+ // Extends Postgres dialect with sharp
48
+ PostgreSqlDialect { } . is_identifier_start ( ch) || ch == '#'
48
49
}
49
50
50
51
fn is_identifier_part ( & self , ch : char ) -> bool {
51
- PostgreSqlDialect { } . is_identifier_part ( ch)
52
+ // Extends Postgres dialect with sharp
53
+ PostgreSqlDialect { } . is_identifier_part ( ch) || ch == '#'
52
54
}
53
55
}
Original file line number Diff line number Diff line change @@ -100,3 +100,13 @@ fn redshift() -> TestedDialects {
100
100
dialects : vec ! [ Box :: new( RedshiftSqlDialect { } ) ] ,
101
101
}
102
102
}
103
+
104
+ #[ test]
105
+ fn test_sharp ( ) {
106
+ let sql = "SELECT #_of_values" ;
107
+ let select = redshift ( ) . verified_only_select ( sql) ;
108
+ assert_eq ! (
109
+ SelectItem :: UnnamedExpr ( Expr :: Identifier ( Ident :: new( "#_of_values" ) ) ) ,
110
+ select. projection[ 0 ]
111
+ ) ;
112
+ }
You can’t perform that action at this time.
0 commit comments