@@ -129,11 +129,28 @@ impl<'a> ExpressionParser for Parser<'a> {
129
129
pub ( crate ) mod test_utils {
130
130
use crate :: ast:: { Expression , SelectItem } ;
131
131
use crate :: {
132
- BinaryOp , CollateExpressionStatement , DataType , ExistsStatement , Function , FunctionArg ,
133
- Identifier , LiteralValue , OverClause , Parser , RaiseFunction , SelectBody , SelectStatement ,
134
- Statement , UnaryOp ,
132
+ BinaryOp , CollateExpressionStatement , DataType , DistinctType , ExistsStatement , Function ,
133
+ FunctionArg , Identifier , LiteralValue , OverClause , Parser , RaiseFunction , Select ,
134
+ SelectBody , SelectStatement , Statement , UnaryOp ,
135
135
} ;
136
136
137
+ pub fn select_expr ( expression : Expression ) -> SelectStatement {
138
+ SelectStatement {
139
+ with_cte : None ,
140
+ select : SelectBody :: Select ( Select {
141
+ distinct_type : DistinctType :: None ,
142
+ columns : vec ! [ SelectItem :: Expression ( expression) ] ,
143
+ from : None ,
144
+ where_clause : None ,
145
+ group_by : None ,
146
+ having : None ,
147
+ window : None ,
148
+ } ) ,
149
+ order_by : None ,
150
+ limit : None ,
151
+ }
152
+ }
153
+
137
154
pub fn run_sunny_day_test_with_multiple_expressions (
138
155
sql : & str ,
139
156
expected_expressions : & [ & Expression ] ,
0 commit comments