pub(crate) struct PreparedQueries {Show 26 fields
txo_insert_queries: SkipMap<u16, Arc<Batch>>,
txo_asset_insert_queries: SkipMap<u16, Arc<Batch>>,
unstaked_txo_insert_queries: SkipMap<u16, Arc<Batch>>,
unstaked_txo_asset_insert_queries: SkipMap<u16, Arc<Batch>>,
txi_insert_queries: SkipMap<u16, Arc<Batch>>,
stake_registration_insert_queries: SkipMap<u16, Arc<Batch>>,
cip36_registration_insert_queries: SkipMap<u16, Arc<Batch>>,
cip36_registration_error_insert_queries: SkipMap<u16, Arc<Batch>>,
cip36_registration_for_stake_address_insert_queries: SkipMap<u16, Arc<Batch>>,
txo_spent_update_queries: SkipMap<u16, Arc<Batch>>,
txo_by_stake_address_query: PreparedStatement,
txi_by_txn_hash_query: PreparedStatement,
rbac509_registration_insert_queries: SkipMap<u16, Arc<Batch>>,
chain_root_for_txn_id_insert_queries: SkipMap<u16, Arc<Batch>>,
chain_root_for_role0_key_insert_queries: SkipMap<u16, Arc<Batch>>,
chain_root_for_stake_address_insert_queries: SkipMap<u16, Arc<Batch>>,
native_assets_by_stake_address_query: PreparedStatement,
registration_from_stake_addr_query: PreparedStatement,
stake_addr_from_stake_hash_query: PreparedStatement,
stake_addr_from_vote_key_query: PreparedStatement,
invalid_registrations_from_stake_addr_query: PreparedStatement,
sync_status_insert: PreparedStatement,
chain_root_by_stake_address_query: PreparedStatement,
registrations_by_chain_root_query: PreparedStatement,
chain_root_by_role0_key_query: PreparedStatement,
get_all_stakes_and_vote_keys_query: PreparedStatement,
}
Expand description
All prepared queries for a session.
Fields§
§txo_insert_queries: SkipMap<u16, Arc<Batch>>
TXO Insert query.
txo_asset_insert_queries: SkipMap<u16, Arc<Batch>>
TXO Asset Insert query.
unstaked_txo_insert_queries: SkipMap<u16, Arc<Batch>>
Unstaked TXO Insert query.
unstaked_txo_asset_insert_queries: SkipMap<u16, Arc<Batch>>
Unstaked TXO Asset Insert query.
txi_insert_queries: SkipMap<u16, Arc<Batch>>
TXI Insert query.
stake_registration_insert_queries: SkipMap<u16, Arc<Batch>>
TXI Insert query.
cip36_registration_insert_queries: SkipMap<u16, Arc<Batch>>
CIP36 Registrations.
cip36_registration_error_insert_queries: SkipMap<u16, Arc<Batch>>
CIP36 Registration errors.
cip36_registration_for_stake_address_insert_queries: SkipMap<u16, Arc<Batch>>
CIP36 Registration for Stake Address Insert query.
txo_spent_update_queries: SkipMap<u16, Arc<Batch>>
Update TXO spent query.
txo_by_stake_address_query: PreparedStatement
Get TXO by stake address query.
txi_by_txn_hash_query: PreparedStatement
Get TXI by transaction hash.
rbac509_registration_insert_queries: SkipMap<u16, Arc<Batch>>
RBAC 509 Registrations.
chain_root_for_txn_id_insert_queries: SkipMap<u16, Arc<Batch>>
Chain Root for TX ID Insert Query..
chain_root_for_role0_key_insert_queries: SkipMap<u16, Arc<Batch>>
Chain Root for Role 0 Key Insert Query..
chain_root_for_stake_address_insert_queries: SkipMap<u16, Arc<Batch>>
Chain Root for Stake Address Insert Query..
native_assets_by_stake_address_query: PreparedStatement
Get native assets by stake address query.
registration_from_stake_addr_query: PreparedStatement
Get registrations
stake_addr_from_stake_hash_query: PreparedStatement
stake addr from stake hash
stake_addr_from_vote_key_query: PreparedStatement
stake addr from vote key
invalid_registrations_from_stake_addr_query: PreparedStatement
Get invalid registrations
sync_status_insert: PreparedStatement
Insert Sync Status update.
chain_root_by_stake_address_query: PreparedStatement
Get chain root by stake address
registrations_by_chain_root_query: PreparedStatement
Get registrations by chain root
chain_root_by_role0_key_query: PreparedStatement
Get chain root by role0 key
get_all_stakes_and_vote_keys_query: PreparedStatement
Get all stake and vote keys (stake_key,vote_key
) for snapshot
Implementations§
Source§impl PreparedQueries
impl PreparedQueries
Sourcepub(crate) async fn new(session: Arc<Session>, cfg: &EnvVars) -> Result<Self>
pub(crate) async fn new(session: Arc<Session>, cfg: &EnvVars) -> Result<Self>
Create new prepared queries for a given session.
Sourcepub(crate) async fn prepare(
session: Arc<Session>,
query: &str,
consistency: Consistency,
idempotent: bool,
) -> Result<PreparedStatement>
pub(crate) async fn prepare( session: Arc<Session>, query: &str, consistency: Consistency, idempotent: bool, ) -> Result<PreparedStatement>
Prepares a statement.
Sourcepub(crate) async fn prepare_batch(
session: Arc<Session>,
query: &str,
cfg: &EnvVars,
consistency: Consistency,
idempotent: bool,
logged: bool,
) -> Result<SkipMap<u16, Arc<Batch>>>
pub(crate) async fn prepare_batch( session: Arc<Session>, query: &str, cfg: &EnvVars, consistency: Consistency, idempotent: bool, logged: bool, ) -> Result<SkipMap<u16, Arc<Batch>>>
Prepares all permutations of the batch from 1 to max. It is necessary to do this because batches are pre-sized, they can not be dynamic. Preparing the batches in advance is a very larger performance increase.
Sourcepub(crate) async fn execute_upsert<P>(
&self,
session: Arc<Session>,
upsert_query: PreparedUpsertQuery,
params: P,
) -> Result<()>where
P: SerializeRow,
pub(crate) async fn execute_upsert<P>(
&self,
session: Arc<Session>,
upsert_query: PreparedUpsertQuery,
params: P,
) -> Result<()>where
P: SerializeRow,
Executes a single query with the given parameters.
Returns no data, and an error if the query fails.
Sourcepub(crate) async fn execute_iter<P>(
&self,
session: Arc<Session>,
select_query: PreparedSelectQuery,
params: P,
) -> Result<QueryPager>where
P: SerializeRow,
pub(crate) async fn execute_iter<P>(
&self,
session: Arc<Session>,
select_query: PreparedSelectQuery,
params: P,
) -> Result<QueryPager>where
P: SerializeRow,
Executes a select query with the given parameters.
Returns an iterator that iterates over all the result pages that the query returns.
Sourcepub(crate) async fn execute_batch<T: SerializeRow + Debug>(
&self,
session: Arc<Session>,
cfg: Arc<EnvVars>,
query: PreparedQuery,
values: Vec<T>,
) -> Result<Vec<QueryResult>>
pub(crate) async fn execute_batch<T: SerializeRow + Debug>( &self, session: Arc<Session>, cfg: Arc<EnvVars>, query: PreparedQuery, values: Vec<T>, ) -> Result<Vec<QueryResult>>
Execute a Batch query with the given parameters.
Values should be a Vec of values which implement SerializeRow
and they MUST be
the same, and must match the query being executed.
This will divide the batch into optimal sized chunks and execute them until all values have been executed or the first error is encountered.
Auto Trait Implementations§
impl !Freeze for PreparedQueries
impl !RefUnwindSafe for PreparedQueries
impl Send for PreparedQueries
impl Sync for PreparedQueries
impl Unpin for PreparedQueries
impl !UnwindSafe for PreparedQueries
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
§impl<T> Conv for T
impl<T> Conv for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request
§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
type Err = Infallible
fn into_result(self) -> Result<T, <T as IntoResult<T>>::Err>
Source§impl<Src, Dst> LosslessTryInto<Dst> for Srcwhere
Dst: LosslessTryFrom<Src>,
impl<Src, Dst> LosslessTryInto<Dst> for Srcwhere
Dst: LosslessTryFrom<Src>,
Source§fn lossless_try_into(self) -> Option<Dst>
fn lossless_try_into(self) -> Option<Dst>
Source§impl<Src, Dst> LossyInto<Dst> for Srcwhere
Dst: LossyFrom<Src>,
impl<Src, Dst> LossyInto<Dst> for Srcwhere
Dst: LossyFrom<Src>,
Source§fn lossy_into(self) -> Dst
fn lossy_into(self) -> Dst
Source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
Source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
Source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self
, then passes self.as_ref()
into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self
, then passes self.as_mut()
into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self
, then passes self.deref()
into the pipe function.§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
Source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
Source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B>
of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B>
of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R>
view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R>
view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target
of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target
of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap()
only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut()
only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow()
only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref()
only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut()
only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref()
only in debug builds, and is erased in release
builds.