11//! Session creation and storage
22
33use std:: {
4+ any:: TypeId ,
45 fmt:: Debug ,
56 path:: PathBuf ,
67 sync:: { Arc , OnceLock } ,
78 time:: Duration ,
89} ;
910
1011use cardano_blockchain_types:: Network ;
12+ use dashmap:: DashMap ;
1113use openssl:: ssl:: { SslContextBuilder , SslFiletype , SslMethod , SslVerifyMode } ;
1214use scylla:: {
1315 frame:: Compression , serialize:: row:: SerializeRow , transport:: iterator:: QueryPager ,
@@ -21,7 +23,7 @@ use super::{
2123 queries:: {
2224 purge:: { self , PreparedDeleteQuery } ,
2325 FallibleQueryResults , PreparedQueries , PreparedQuery , PreparedSelectQuery ,
24- PreparedUpsertQuery ,
26+ PreparedUpsertQuery , QueryKind ,
2527 } ,
2628 schema:: create_schema,
2729} ;
@@ -115,6 +117,9 @@ pub(crate) struct CassandraSession {
115117 queries : Arc < PreparedQueries > ,
116118 /// All prepared purge queries we can use on this session.
117119 purge_queries : Arc < purge:: PreparedQueries > ,
120+ /// All prepared queries we can use on this session.
121+ #[ allow( dead_code) ]
122+ prepared_queries : DashMap < TypeId , QueryKind > ,
118123}
119124
120125/// Session error while initialization.
@@ -433,6 +438,7 @@ async fn retry_init(cfg: cassandra_db::EnvVars, network: Network, persistent: bo
433438 session,
434439 queries,
435440 purge_queries,
441+ prepared_queries : DashMap :: default ( ) ,
436442 } ;
437443
438444 // Save the session so we can execute queries on the DB
0 commit comments