File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -139,6 +139,7 @@ impl StmtKind {
139139 ) )
140140 }
141141 Cmd :: Stmt ( Stmt :: Detach ( _) ) => Some ( Self :: Detach ) ,
142+ Cmd :: Stmt ( Stmt :: Reindex { .. } ) => Some ( Self :: Write ) ,
142143 _ => None ,
143144 }
144145 }
Original file line number Diff line number Diff line change @@ -355,3 +355,27 @@ fn stream() {
355355
356356 sim. run ( ) . unwrap ( ) ;
357357}
358+
359+ #[ test]
360+ fn reindex_statement ( ) {
361+ let mut sim = turmoil:: Builder :: new ( )
362+ . simulation_duration ( Duration :: from_secs ( 1000 ) )
363+ . build ( ) ;
364+ sim. host ( "primary" , super :: make_standalone_server) ;
365+ sim. client ( "client" , async {
366+ let db = Database :: open_remote_with_connector ( "http://primary:8080" , "" , TurmoilConnector ) ?;
367+ let conn = db. connect ( ) ?;
368+
369+ conn. execute ( "create table t(x text)" , ( ) ) . await ?;
370+ conn. execute ( "create index t_idx on t(x)" , ( ) ) . await ?;
371+ conn. execute ( "insert into t(x) values(?)" , params ! [ "hello" ] )
372+ . await ?;
373+ conn. execute ( "insert into t(x) values(?)" , params ! [ "hello" ] )
374+ . await ?;
375+ conn. execute ( "reindex t_idx" , ( ) ) . await ?;
376+
377+ Ok ( ( ) )
378+ } ) ;
379+
380+ sim. run ( ) . unwrap ( ) ;
381+ }
Original file line number Diff line number Diff line change @@ -120,6 +120,7 @@ impl StmtKind {
120120 } ) => Some ( Self :: Release ) ,
121121 Cmd :: Stmt ( Stmt :: Attach { .. } ) => Some ( Self :: Attach ) ,
122122 Cmd :: Stmt ( Stmt :: Detach ( _) ) => Some ( Self :: Detach ) ,
123+ Cmd :: Stmt ( Stmt :: Reindex { .. } ) => Some ( Self :: Write ) ,
123124 _ => None ,
124125 }
125126 }
You can’t perform that action at this time.
0 commit comments