Google Cloud Spanner C++ Client 2.13.0
A C++ Client Library for Google Cloud Spanner
Loading...
Searching...
No Matches
Public Member Functions | List of all members
google::cloud::spanner::CommitOptions Class Reference

Set options on calls to spanner::Client::Commit(). More...

#include <google/cloud/spanner/commit_options.h>

Public Member Functions

 CommitOptions ()=default
 Default options: no stats. More...
 
 CommitOptions (Options const &opts)
 Constructs from the new, recommended way to represent options of all varieties, google::cloud::Options. More...
 
 operator Options () const
 Converts to the new, recommended way to represent options of all varieties, google::cloud::Options. More...
 
CommitOptionsset_return_stats (bool return_stats)
 Set whether the CommitResult should contain CommitStats. More...
 
bool return_stats () const
 Whether the CommitResult should contain CommitStats. More...
 
CommitOptionsset_request_priority (absl::optional< RequestPriority > request_priority)
 Set the priority of the spanner::Client::Commit() call. More...
 
absl::optional< RequestPriorityrequest_priority () const
 The priority of the spanner::Client::Commit() call. More...
 
CommitOptionsset_transaction_tag (absl::optional< std::string > transaction_tag)
 Set the transaction tag for the spanner::Client::Commit() call. More...
 
absl::optional< std::string > const & transaction_tag () const
 The transaction tag for the spanner::Client::Commit() call. More...
 

Detailed Description

Set options on calls to spanner::Client::Commit().

Example
auto commit = client.Commit(
"Albums", {"SingerId", "AlbumId", "MarketingBudget"})
.EmplaceRow(1, 1, 200000)
.EmplaceRow(2, 2, 400000)
.Build()},
google::cloud::Options{}.set<spanner::CommitReturnStatsOption>(true));
Options & set(ValueTypeT< T > v)
spanner_internal::WriteMutationBuilder< spanner_internal::UpdateOp > UpdateMutationBuilder
A helper class to construct "update" mutations.
Definition: mutations.h:249
std::vector< Mutation > Mutations
An ordered sequence of mutations to pass to Client::Commit() or return from the Client::Commit() muta...
Definition: mutations.h:99

Constructor & Destructor Documentation

◆ CommitOptions() [1/2]

google::cloud::spanner::CommitOptions::CommitOptions ( )
default

Default options: no stats.

◆ CommitOptions() [2/2]

google::cloud::spanner::CommitOptions::CommitOptions ( Options const &  opts)
explicit

Constructs from the new, recommended way to represent options of all varieties, google::cloud::Options.

Member Function Documentation

◆ operator Options()

google::cloud::spanner::CommitOptions::operator Options ( ) const
explicit

Converts to the new, recommended way to represent options of all varieties, google::cloud::Options.

◆ request_priority()

absl::optional< RequestPriority > google::cloud::spanner::CommitOptions::request_priority ( ) const
inline

The priority of the spanner::Client::Commit() call.

◆ return_stats()

bool google::cloud::spanner::CommitOptions::return_stats ( ) const
inline

Whether the CommitResult should contain CommitStats.

◆ set_request_priority()

CommitOptions & google::cloud::spanner::CommitOptions::set_request_priority ( absl::optional< RequestPriority request_priority)
inline

Set the priority of the spanner::Client::Commit() call.

◆ set_return_stats()

CommitOptions & google::cloud::spanner::CommitOptions::set_return_stats ( bool  return_stats)
inline

Set whether the CommitResult should contain CommitStats.

◆ set_transaction_tag()

CommitOptions & google::cloud::spanner::CommitOptions::set_transaction_tag ( absl::optional< std::string >  transaction_tag)
inline

Set the transaction tag for the spanner::Client::Commit() call.

Ignored for the overload that already takes a spanner::Transaction.

◆ transaction_tag()

absl::optional< std::string > const & google::cloud::spanner::CommitOptions::transaction_tag ( ) const
inline

The transaction tag for the spanner::Client::Commit() call.