pub struct QueryTransaction {
pub identity: IdentityId,
/* private fields */
}Expand description
An active query transaction that holds a multi query transaction and provides query-only access to single storage.
Fields§
§identity: IdentityIdThe identity executing this transaction.
Implementations§
Source§impl QueryTransaction
impl QueryTransaction
Sourcepub fn new(
multi: MultiReadTransaction,
single: SingleTransaction,
identity: IdentityId,
) -> Self
pub fn new( multi: MultiReadTransaction, single: SingleTransaction, identity: IdentityId, ) -> Self
Creates a new active query transaction
Sourcepub fn set_executor(&mut self, executor: Arc<dyn RqlExecutor>)
pub fn set_executor(&mut self, executor: Arc<dyn RqlExecutor>)
Set the RQL executor for this transaction.
Sourcepub fn rql(&mut self, rql: &str, params: Params) -> ExecutionResult
pub fn rql(&mut self, rql: &str, params: Params) -> ExecutionResult
Execute RQL within this transaction using the attached executor.
Panics if no RqlExecutor has been set on this transaction.
Sourcepub fn version(&self) -> CommitVersion
pub fn version(&self) -> CommitVersion
Get the transaction version
Sourcepub fn id(&self) -> TransactionId
pub fn id(&self) -> TransactionId
Get the transaction ID
Sourcepub fn get(&mut self, key: &EncodedKey) -> Result<Option<MultiVersionRow>>
pub fn get(&mut self, key: &EncodedKey) -> Result<Option<MultiVersionRow>>
Get a value by key
Sourcepub fn contains_key(&mut self, key: &EncodedKey) -> Result<bool>
pub fn contains_key(&mut self, key: &EncodedKey) -> Result<bool>
Check if a key exists
Sourcepub fn prefix(&mut self, prefix: &EncodedKey) -> Result<MultiVersionBatch>
pub fn prefix(&mut self, prefix: &EncodedKey) -> Result<MultiVersionBatch>
Get a prefix batch
Sourcepub fn prefix_rev(&mut self, prefix: &EncodedKey) -> Result<MultiVersionBatch>
pub fn prefix_rev(&mut self, prefix: &EncodedKey) -> Result<MultiVersionBatch>
Get a reverse prefix batch
Sourcepub fn read_as_of_version_exclusive(
&mut self,
version: CommitVersion,
) -> Result<()>
pub fn read_as_of_version_exclusive( &mut self, version: CommitVersion, ) -> Result<()>
Read as of version exclusive
Sourcepub fn range(
&self,
range: EncodedKeyRange,
batch_size: usize,
) -> Box<dyn Iterator<Item = Result<MultiVersionRow>> + Send + '_>
pub fn range( &self, range: EncodedKeyRange, batch_size: usize, ) -> Box<dyn Iterator<Item = Result<MultiVersionRow>> + Send + '_>
Create a streaming iterator for forward range queries.
Sourcepub fn range_rev(
&self,
range: EncodedKeyRange,
batch_size: usize,
) -> Box<dyn Iterator<Item = Result<MultiVersionRow>> + Send + '_>
pub fn range_rev( &self, range: EncodedKeyRange, batch_size: usize, ) -> Box<dyn Iterator<Item = Result<MultiVersionRow>> + Send + '_>
Create a streaming iterator for reverse range queries.
Sourcepub fn with_single_query<'a, I, F, R>(&self, keys: I, f: F) -> Result<R>where
I: IntoIterator<Item = &'a EncodedKey> + Send,
F: FnOnce(&mut SingleReadTransaction<'_>) -> Result<R> + Send,
R: Send,
pub fn with_single_query<'a, I, F, R>(&self, keys: I, f: F) -> Result<R>where
I: IntoIterator<Item = &'a EncodedKey> + Send,
F: FnOnce(&mut SingleReadTransaction<'_>) -> Result<R> + Send,
R: Send,
Execute a function with query access to the single transaction.
Sourcepub fn with_multi_query<F, R>(&mut self, f: F) -> Result<R>
pub fn with_multi_query<F, R>(&mut self, f: F) -> Result<R>
Execute a function with access to the multi query transaction. This operates within the same transaction context.
Sourcepub fn begin_single_query<'a, I>(
&self,
keys: I,
) -> Result<SingleReadTransaction<'_>>where
I: IntoIterator<Item = &'a EncodedKey>,
pub fn begin_single_query<'a, I>(
&self,
keys: I,
) -> Result<SingleReadTransaction<'_>>where
I: IntoIterator<Item = &'a EncodedKey>,
Begin a single-version query transaction for specific keys
Trait Implementations§
Source§impl<'a> From<&'a mut QueryTransaction> for Transaction<'a>
impl<'a> From<&'a mut QueryTransaction> for Transaction<'a>
Source§fn from(txn: &'a mut QueryTransaction) -> Self
fn from(txn: &'a mut QueryTransaction) -> Self
Source§impl TransactionalAuthenticationChanges for QueryTransaction
impl TransactionalAuthenticationChanges for QueryTransaction
fn find_authentication(&self, _id: AuthenticationId) -> Option<&Authentication>
fn find_authentication_by_identity_and_method( &self, _identity: IdentityId, _method: &str, ) -> Option<&Authentication>
fn is_authentication_deleted(&self, _id: AuthenticationId) -> bool
fn is_authentication_deleted_by_identity_and_method( &self, _identity: IdentityId, _method: &str, ) -> bool
Source§impl TransactionalBindingChanges for QueryTransaction
impl TransactionalBindingChanges for QueryTransaction
fn find_binding(&self, _id: BindingId) -> Option<&Binding>
fn find_binding_by_name( &self, _namespace: NamespaceId, _name: &str, ) -> Option<&Binding>
fn is_binding_deleted(&self, _id: BindingId) -> bool
fn is_binding_deleted_by_name( &self, _namespace: NamespaceId, _name: &str, ) -> bool
Source§impl TransactionalDictionaryChanges for QueryTransaction
impl TransactionalDictionaryChanges for QueryTransaction
fn find_dictionary(&self, _id: DictionaryId) -> Option<&Dictionary>
fn find_dictionary_by_name( &self, _namespace: NamespaceId, _name: &str, ) -> Option<&Dictionary>
fn is_dictionary_deleted(&self, _id: DictionaryId) -> bool
fn is_dictionary_deleted_by_name( &self, _namespace: NamespaceId, _name: &str, ) -> bool
Source§impl TransactionalFlowChanges for QueryTransaction
impl TransactionalFlowChanges for QueryTransaction
fn find_flow(&self, _id: FlowId) -> Option<&Flow>
fn find_flow_by_name( &self, _namespace: NamespaceId, _name: &str, ) -> Option<&Flow>
fn is_flow_deleted(&self, _id: FlowId) -> bool
fn is_flow_deleted_by_name(&self, _namespace: NamespaceId, _name: &str) -> bool
Source§impl TransactionalGrantedRoleChanges for QueryTransaction
impl TransactionalGrantedRoleChanges for QueryTransaction
fn find_granted_role( &self, _identity: IdentityId, _role: RoleId, ) -> Option<&GrantedRole>
fn find_granted_roles_for_identity( &self, _identity: IdentityId, ) -> Vec<&GrantedRole>
fn is_granted_role_deleted(&self, _identity: IdentityId, _role: RoleId) -> bool
Source§impl TransactionalHandlerChanges for QueryTransaction
impl TransactionalHandlerChanges for QueryTransaction
fn find_handler_by_id(&self, _id: HandlerId) -> Option<&Handler>
fn find_handler_by_name( &self, _namespace: NamespaceId, _name: &str, ) -> Option<&Handler>
fn is_handler_deleted(&self, _id: HandlerId) -> bool
fn is_handler_deleted_by_name( &self, _namespace: NamespaceId, _name: &str, ) -> bool
Source§impl TransactionalIdentityChanges for QueryTransaction
impl TransactionalIdentityChanges for QueryTransaction
fn find_identity(&self, _id: IdentityId) -> Option<&Identity>
fn find_identity_by_name(&self, _name: &str) -> Option<&Identity>
fn is_identity_deleted(&self, _id: IdentityId) -> bool
fn is_identity_deleted_by_name(&self, _name: &str) -> bool
Source§impl TransactionalMigrationChanges for QueryTransaction
impl TransactionalMigrationChanges for QueryTransaction
fn find_migration(&self, _id: MigrationId) -> Option<&Migration>
fn find_migration_by_name(&self, _name: &str) -> Option<&Migration>
fn is_migration_deleted(&self, _id: MigrationId) -> bool
fn is_migration_deleted_by_name(&self, _name: &str) -> bool
Source§impl TransactionalNamespaceChanges for QueryTransaction
impl TransactionalNamespaceChanges for QueryTransaction
fn find_namespace(&self, _id: NamespaceId) -> Option<&Namespace>
fn find_namespace_by_name(&self, _name: &str) -> Option<&Namespace>
fn is_namespace_deleted(&self, _id: NamespaceId) -> bool
fn is_namespace_deleted_by_name(&self, _name: &str) -> bool
Source§impl TransactionalProcedureChanges for QueryTransaction
impl TransactionalProcedureChanges for QueryTransaction
fn find_procedure(&self, _id: ProcedureId) -> Option<&Procedure>
fn find_procedure_by_name( &self, _namespace: NamespaceId, _name: &str, ) -> Option<&Procedure>
fn is_procedure_deleted(&self, _id: ProcedureId) -> bool
fn is_procedure_deleted_by_name( &self, _namespace: NamespaceId, _name: &str, ) -> bool
Source§impl TransactionalRingBufferChanges for QueryTransaction
impl TransactionalRingBufferChanges for QueryTransaction
fn find_ringbuffer(&self, _id: RingBufferId) -> Option<&RingBuffer>
fn find_ringbuffer_by_name( &self, _namespace: NamespaceId, _name: &str, ) -> Option<&RingBuffer>
fn is_ringbuffer_deleted(&self, _id: RingBufferId) -> bool
fn is_ringbuffer_deleted_by_name( &self, _namespace: NamespaceId, _name: &str, ) -> bool
Source§impl TransactionalSeriesChanges for QueryTransaction
impl TransactionalSeriesChanges for QueryTransaction
fn find_series(&self, _id: SeriesId) -> Option<&Series>
fn find_series_by_name( &self, _namespace: NamespaceId, _name: &str, ) -> Option<&Series>
fn is_series_deleted(&self, _id: SeriesId) -> bool
fn is_series_deleted_by_name( &self, _namespace: NamespaceId, _name: &str, ) -> bool
Source§impl TransactionalSinkChanges for QueryTransaction
impl TransactionalSinkChanges for QueryTransaction
fn find_sink(&self, _id: SinkId) -> Option<&Sink>
fn find_sink_by_name( &self, _namespace: NamespaceId, _name: &str, ) -> Option<&Sink>
fn is_sink_deleted(&self, _id: SinkId) -> bool
fn is_sink_deleted_by_name(&self, _namespace: NamespaceId, _name: &str) -> bool
Source§impl TransactionalSourceChanges for QueryTransaction
impl TransactionalSourceChanges for QueryTransaction
fn find_source(&self, _id: SourceId) -> Option<&Source>
fn find_source_by_name( &self, _namespace: NamespaceId, _name: &str, ) -> Option<&Source>
fn is_source_deleted(&self, _id: SourceId) -> bool
fn is_source_deleted_by_name( &self, _namespace: NamespaceId, _name: &str, ) -> bool
Source§impl TransactionalSumTypeChanges for QueryTransaction
impl TransactionalSumTypeChanges for QueryTransaction
fn find_sumtype(&self, _id: SumTypeId) -> Option<&SumType>
fn find_sumtype_by_name( &self, _namespace: NamespaceId, _name: &str, ) -> Option<&SumType>
fn is_sumtype_deleted(&self, _id: SumTypeId) -> bool
fn is_sumtype_deleted_by_name( &self, _namespace: NamespaceId, _name: &str, ) -> bool
Source§impl TransactionalTableChanges for QueryTransaction
impl TransactionalTableChanges for QueryTransaction
fn find_table(&self, _id: TableId) -> Option<&Table>
fn find_table_by_name( &self, _namespace: NamespaceId, _name: &str, ) -> Option<&Table>
fn is_table_deleted(&self, _id: TableId) -> bool
fn is_table_deleted_by_name(&self, _namespace: NamespaceId, _name: &str) -> bool
Source§impl TransactionalTestChanges for QueryTransaction
impl TransactionalTestChanges for QueryTransaction
fn find_test(&self, _id: TestId) -> Option<&Test>
fn find_test_by_name( &self, _namespace: NamespaceId, _name: &str, ) -> Option<&Test>
fn is_test_deleted(&self, _id: TestId) -> bool
fn is_test_deleted_by_name(&self, _namespace: NamespaceId, _name: &str) -> bool
Source§impl TransactionalViewChanges for QueryTransaction
impl TransactionalViewChanges for QueryTransaction
fn find_view(&self, _id: ViewId) -> Option<&View>
fn find_view_by_name( &self, _namespace: NamespaceId, _name: &str, ) -> Option<&View>
fn is_view_deleted(&self, _id: ViewId) -> bool
fn is_view_deleted_by_name(&self, _namespace: NamespaceId, _name: &str) -> bool
impl TransactionalChanges for QueryTransaction
Auto Trait Implementations§
impl Freeze for QueryTransaction
impl !RefUnwindSafe for QueryTransaction
impl Send for QueryTransaction
impl Sync for QueryTransaction
impl Unpin for QueryTransaction
impl UnsafeUnpin for QueryTransaction
impl !UnwindSafe for QueryTransaction
Blanket Implementations§
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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 more