Struct google_cloud_spanner::transaction_ro::ReadOnlyTransaction [−][src]
Expand description
ReadOnlyTransaction provides a snapshot transaction with guaranteed consistency across reads, but does not allow writes. Read-only transactions can be configured to read at timestamps in the past.
Read-only transactions do not take locks. Instead, they work by choosing a Cloud Spanner timestamp, then executing all reads at that timestamp. Since they do not acquire locks, they do not block concurrent read-write transactions.
Unlike locking read-write transactions, read-only transactions never abort. They can fail if the chosen read timestamp is garbage collected; however, the default garbage collection policy is generous enough that most applications do not need to worry about this in practice. See the documentation of TimestampBound for more details.
Fields
rts: Option<DateTime<Utc>>Implementations
pub async fn single(
session: ManagedSession,
tb: TimestampBound
) -> Result<ReadOnlyTransaction, Status>
pub async fn begin(
session: ManagedSession,
tb: TimestampBound,
options: CallOptions
) -> Result<ReadOnlyTransaction, Status>
pub async fn begin(
session: ManagedSession,
tb: TimestampBound,
options: CallOptions
) -> Result<ReadOnlyTransaction, Status>
begin starts a snapshot read-only Transaction on Cloud Spanner.
Methods from Deref<Target = Transaction>
query executes a query against the database. It returns a RowIterator for retrieving the resulting rows.
query returns only row data, without a query plan or execution statistics.
pub async fn query_with_option(
&mut self,
statement: Statement,
options: QueryOptions
) -> Result<RowIterator<'_>, Status>
pub async fn query_with_option(
&mut self,
statement: Statement,
options: QueryOptions
) -> Result<RowIterator<'_>, Status>
query executes a query against the database. It returns a RowIterator for retrieving the resulting rows.
query returns only row data, without a query plan or execution statistics.
read returns a RowIterator for reading multiple rows from the database.
pub async fn read_with_option<T, C, K>(
&mut self,
table: T,
columns: Vec<C>,
key_set: K,
options: ReadOptions
) -> Result<RowIterator<'_>, Status> where
T: Into<String>,
C: Into<String>,
K: Into<KeySet>,
pub async fn read_with_option<T, C, K>(
&mut self,
table: T,
columns: Vec<C>,
key_set: K,
options: ReadOptions
) -> Result<RowIterator<'_>, Status> where
T: Into<String>,
C: Into<String>,
K: Into<KeySet>,
read returns a RowIterator for reading multiple rows from the database.
read returns a RowIterator for reading multiple rows from the database.
Trait Implementations
type Target = Transaction
type Target = Transaction
The resulting type after dereferencing.
Auto Trait Implementations
impl !RefUnwindSafe for ReadOnlyTransaction
impl Send for ReadOnlyTransaction
impl Sync for ReadOnlyTransaction
impl Unpin for ReadOnlyTransaction
impl !UnwindSafe for ReadOnlyTransaction
Blanket Implementations
Mutably borrows from an owned value. Read more
Wrap the input message T in a tonic::Request
pub fn vzip(self) -> V
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more