@@ -18,22 +18,22 @@ use crate::metrics::{
1818 DESCRIBE_COUNT , PROGRAM_EXEC_COUNT , READ_QUERY_COUNT , VACUUM_COUNT , WAL_CHECKPOINT_COUNT ,
1919 WRITE_QUERY_COUNT , WRITE_TXN_DURATION ,
2020} ;
21+ use crate :: namespace:: meta_store:: MetaStoreHandle ;
2122use crate :: query:: Query ;
2223use crate :: query_analysis:: { StmtKind , TxnStatus } ;
2324use crate :: query_result_builder:: { QueryBuilderConfig , QueryResultBuilder } ;
2425use crate :: replication:: FrameNo ;
2526use crate :: stats:: Stats ;
2627use crate :: Result ;
2728
28- use super :: config:: DatabaseConfigStore ;
2929use super :: program:: { Cond , DescribeCol , DescribeParam , DescribeResponse } ;
3030use super :: { MakeConnection , Program , Step , TXN_TIMEOUT } ;
3131
3232pub struct MakeLibSqlConn < T : WalManager > {
3333 db_path : PathBuf ,
3434 wal_manager : T ,
3535 stats : Arc < Stats > ,
36- config_store : Arc < DatabaseConfigStore > ,
36+ config_store : MetaStoreHandle ,
3737 extensions : Arc < [ PathBuf ] > ,
3838 max_response_size : u64 ,
3939 max_total_response_size : u64 ,
5555 db_path : PathBuf ,
5656 wal_manager : T ,
5757 stats : Arc < Stats > ,
58- config_store : Arc < DatabaseConfigStore > ,
58+ config_store : MetaStoreHandle ,
5959 extensions : Arc < [ PathBuf ] > ,
6060 max_response_size : u64 ,
6161 max_total_response_size : u64 ,
@@ -241,7 +241,7 @@ where
241241 extensions : Arc < [ PathBuf ] > ,
242242 wal_manager : T ,
243243 stats : Arc < Stats > ,
244- config_store : Arc < DatabaseConfigStore > ,
244+ config_store : MetaStoreHandle ,
245245 builder_config : QueryBuilderConfig ,
246246 current_frame_no_receiver : watch:: Receiver < Option < FrameNo > > ,
247247 state : Arc < TxnState < W > > ,
@@ -292,7 +292,7 @@ impl LibSqlConnection<libsql_sys::wal::Sqlite3Wal> {
292292 Arc :: new ( [ ] ) ,
293293 libsql_sys:: wal:: Sqlite3WalManager :: new ( ) ,
294294 Default :: default ( ) ,
295- DatabaseConfigStore :: new_test ( ) . into ( ) ,
295+ MetaStoreHandle :: new_test ( ) . into ( ) ,
296296 QueryBuilderConfig :: default ( ) ,
297297 rcv,
298298 Default :: default ( ) ,
@@ -308,7 +308,7 @@ impl LibSqlConnection<libsql_sys::wal::Sqlite3Wal> {
308308struct Connection < T > {
309309 conn : libsql_sys:: Connection < T > ,
310310 stats : Arc < Stats > ,
311- config_store : Arc < DatabaseConfigStore > ,
311+ config_store : MetaStoreHandle ,
312312 builder_config : QueryBuilderConfig ,
313313 current_frame_no_receiver : watch:: Receiver < Option < FrameNo > > ,
314314 // must be dropped after the connection because the connection refers to it
@@ -487,7 +487,7 @@ impl<W: Wal> Connection<W> {
487487 extensions : Arc < [ PathBuf ] > ,
488488 wal_manager : T ,
489489 stats : Arc < Stats > ,
490- config_store : Arc < DatabaseConfigStore > ,
490+ config_store : MetaStoreHandle ,
491491 builder_config : QueryBuilderConfig ,
492492 current_frame_no_receiver : watch:: Receiver < Option < FrameNo > > ,
493493 state : Arc < TxnState < W > > ,
@@ -674,6 +674,7 @@ impl<W: Wal> Connection<W> {
674674
675675 let start = Instant :: now ( ) ;
676676 let config = self . config_store . get ( ) ;
677+
677678 let blocked = match query. stmt . kind {
678679 StmtKind :: Read | StmtKind :: TxnBegin | StmtKind :: Other => config. block_reads ,
679680 StmtKind :: Write => config. block_reads || config. block_writes ,
@@ -987,7 +988,7 @@ mod test {
987988 let conn = Connection {
988989 conn : libsql_sys:: Connection :: test ( ) ,
989990 stats : Arc :: new ( Stats :: default ( ) ) ,
990- config_store : Arc :: new ( DatabaseConfigStore :: new_test ( ) ) ,
991+ config_store : MetaStoreHandle :: new_test ( ) ,
991992 builder_config : QueryBuilderConfig :: default ( ) ,
992993 current_frame_no_receiver : watch:: channel ( None ) . 1 ,
993994 state : Default :: default ( ) ,
@@ -1019,7 +1020,7 @@ mod test {
10191020 tmp. path ( ) . into ( ) ,
10201021 Sqlite3WalManager :: new ( ) ,
10211022 Default :: default ( ) ,
1022- Arc :: new ( DatabaseConfigStore :: load ( tmp. path ( ) ) . unwrap ( ) ) ,
1023+ MetaStoreHandle :: load ( tmp. path ( ) ) . unwrap ( ) ,
10231024 Arc :: new ( [ ] ) ,
10241025 100000000 ,
10251026 100000000 ,
@@ -1060,7 +1061,7 @@ mod test {
10601061 tmp. path ( ) . into ( ) ,
10611062 Sqlite3WalManager :: new ( ) ,
10621063 Default :: default ( ) ,
1063- Arc :: new ( DatabaseConfigStore :: load ( tmp. path ( ) ) . unwrap ( ) ) ,
1064+ MetaStoreHandle :: load ( tmp. path ( ) ) . unwrap ( ) ,
10641065 Arc :: new ( [ ] ) ,
10651066 100000000 ,
10661067 100000000 ,
@@ -1102,7 +1103,7 @@ mod test {
11021103 tmp. path ( ) . into ( ) ,
11031104 Sqlite3WalManager :: new ( ) ,
11041105 Default :: default ( ) ,
1105- Arc :: new ( DatabaseConfigStore :: load ( tmp. path ( ) ) . unwrap ( ) ) ,
1106+ MetaStoreHandle :: load ( tmp. path ( ) ) . unwrap ( ) ,
11061107 Arc :: new ( [ ] ) ,
11071108 100000000 ,
11081109 100000000 ,
@@ -1180,7 +1181,7 @@ mod test {
11801181 tmp. path ( ) . into ( ) ,
11811182 Sqlite3WalManager :: new ( ) ,
11821183 Default :: default ( ) ,
1183- Arc :: new ( DatabaseConfigStore :: load ( tmp. path ( ) ) . unwrap ( ) ) ,
1184+ MetaStoreHandle :: load ( tmp. path ( ) ) . unwrap ( ) ,
11841185 Arc :: new ( [ ] ) ,
11851186 100000000 ,
11861187 100000000 ,
@@ -1245,7 +1246,7 @@ mod test {
12451246 }
12461247 } ;
12471248
1248- tokio:: time:: timeout ( Duration :: from_secs ( 30 ) , join_all)
1249+ tokio:: time:: timeout ( Duration :: from_secs ( 60 ) , join_all)
12491250 . await
12501251 . expect ( "timed out running connections" ) ;
12511252 }
0 commit comments