11//! Update the TXO Spent column to optimize future queries.
22
3- use std:: { fmt , sync:: Arc } ;
3+ use std:: sync:: Arc ;
44
55use scylla:: { SerializeRow , Session } ;
66use tracing:: error;
77
88use crate :: {
99 db:: {
1010 index:: {
11- queries:: {
12- FallibleQueryResults , PreparedQueries , PreparedQuery , Query , QueryKind , SizedBatch ,
13- } ,
11+ queries:: { FallibleQueryResults , PreparedQueries , PreparedQuery , SizedBatch } ,
1412 session:: CassandraSession ,
1513 } ,
1614 types:: { DbSlot , DbStakeAddress , DbTxnIndex , DbTxnOutputOffset } ,
1715 } ,
16+ impl_query_batch,
1817 settings:: cassandra_db,
1918} ;
2019
@@ -39,22 +38,7 @@ pub(crate) struct UpdateTxoSpentQueryParams {
3938/// Update TXO spent query.
4039pub ( crate ) struct UpdateTxoSpentQuery ;
4140
42- impl Query for UpdateTxoSpentQuery {
43- /// Prepare Batch of Insert TXI Index Data Queries
44- async fn prepare_query (
45- session : & Arc < Session > , cfg : & cassandra_db:: EnvVars ,
46- ) -> anyhow:: Result < QueryKind > {
47- Self :: prepare_batch ( session, cfg)
48- . await
49- . map ( QueryKind :: Batch )
50- }
51- }
52-
53- impl fmt:: Display for UpdateTxoSpentQuery {
54- fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
55- write ! ( f, "{UPDATE_TXO_SPENT_QUERY}" )
56- }
57- }
41+ impl_query_batch ! ( UpdateTxoSpentQuery , UPDATE_TXO_SPENT_QUERY ) ;
5842
5943impl UpdateTxoSpentQuery {
6044 /// Prepare a batch of update TXO spent queries.
0 commit comments