@@ -24,8 +24,8 @@ use derive_visitor::DriveMut;
2424use crate :: ast:: CreateOption ;
2525use crate :: ast:: Identifier ;
2626use crate :: ast:: Query ;
27+ use crate :: ast:: TableRef ;
2728use crate :: ast:: write_comma_separated_list;
28- use crate :: ast:: write_dot_separated_list;
2929use crate :: ast:: write_space_separated_string_map;
3030
3131#[ derive( Debug , Clone , PartialEq , Drive , DriveMut , Walk , WalkMut ) ]
@@ -131,9 +131,7 @@ pub struct CreateTableIndexStmt {
131131 pub index_name : Identifier ,
132132 pub index_type : TableIndexType ,
133133
134- pub catalog : Option < Identifier > ,
135- pub database : Option < Identifier > ,
136- pub table : Identifier ,
134+ pub table : TableRef ,
137135
138136 pub columns : Vec < Identifier > ,
139137 pub sync_creation : bool ,
@@ -155,14 +153,7 @@ impl Display for CreateTableIndexStmt {
155153 }
156154
157155 write ! ( f, " {}" , self . index_name) ?;
158- write ! ( f, " ON " ) ?;
159- write_dot_separated_list (
160- f,
161- self . catalog
162- . iter ( )
163- . chain ( & self . database )
164- . chain ( Some ( & self . table ) ) ,
165- ) ?;
156+ write ! ( f, " ON {}" , self . table) ?;
166157 write ! ( f, " (" ) ?;
167158 write_comma_separated_list ( f, & self . columns ) ?;
168159 write ! ( f, ")" ) ?;
@@ -181,9 +172,7 @@ pub struct DropTableIndexStmt {
181172 pub if_exists : bool ,
182173 pub index_name : Identifier ,
183174 pub index_type : TableIndexType ,
184- pub catalog : Option < Identifier > ,
185- pub database : Option < Identifier > ,
186- pub table : Identifier ,
175+ pub table : TableRef ,
187176}
188177
189178impl Display for DropTableIndexStmt {
@@ -194,14 +183,7 @@ impl Display for DropTableIndexStmt {
194183 }
195184
196185 write ! ( f, " {}" , self . index_name) ?;
197- write ! ( f, " ON " ) ?;
198- write_dot_separated_list (
199- f,
200- self . catalog
201- . iter ( )
202- . chain ( & self . database )
203- . chain ( Some ( & self . table ) ) ,
204- ) ?;
186+ write ! ( f, " ON {}" , self . table) ?;
205187 Ok ( ( ) )
206188 }
207189}
@@ -210,24 +192,15 @@ impl Display for DropTableIndexStmt {
210192pub struct RefreshTableIndexStmt {
211193 pub index_name : Identifier ,
212194 pub index_type : TableIndexType ,
213- pub catalog : Option < Identifier > ,
214- pub database : Option < Identifier > ,
215- pub table : Identifier ,
195+ pub table : TableRef ,
216196 pub limit : Option < u64 > ,
217197}
218198
219199impl Display for RefreshTableIndexStmt {
220200 fn fmt ( & self , f : & mut Formatter ) -> std:: fmt:: Result {
221201 write ! ( f, "REFRESH {} INDEX" , self . index_type) ?;
222202 write ! ( f, " {}" , self . index_name) ?;
223- write ! ( f, " ON " ) ?;
224- write_dot_separated_list (
225- f,
226- self . catalog
227- . iter ( )
228- . chain ( & self . database )
229- . chain ( Some ( & self . table ) ) ,
230- ) ?;
203+ write ! ( f, " ON {}" , self . table) ?;
231204 if let Some ( limit) = self . limit {
232205 write ! ( f, " LIMIT {limit}" ) ?;
233206 }
0 commit comments