Skip to content

Commit d1fc99b

Browse files
committed
feat(cat-gateway): add prepared_queries field to CassandraSession
1 parent 7c6e823 commit d1fc99b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

catalyst-gateway/bin/src/db/index/session.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
//! Session creation and storage
22
33
use std::{
4+
any::TypeId,
45
fmt::Debug,
56
path::PathBuf,
67
sync::{Arc, OnceLock},
78
time::Duration,
89
};
910

1011
use cardano_blockchain_types::Network;
12+
use dashmap::DashMap;
1113
use openssl::ssl::{SslContextBuilder, SslFiletype, SslMethod, SslVerifyMode};
1214
use 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

Comments
 (0)