Google Cloud Spanner C++ Client  1.32.1
A C++ Client Library for Google Cloud Spanner
Public Member Functions | List of all members
google::cloud::spanner::v1::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...
 
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()},
Set options on calls to spanner::Client::Commit().
CommitOptions & set_return_stats(bool return_stats)
Set whether the CommitResult should contain CommitStats.
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
spanner_internal::WriteMutationBuilder< spanner_internal::UpdateOp > UpdateMutationBuilder
A helper class to construct "update" mutations.
Definition: mutations.h:249

Definition at line 34 of file commit_options.h.

Constructor & Destructor Documentation

◆ CommitOptions()

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

Default options: no stats.

Member Function Documentation

◆ request_priority()

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

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

Definition at line 56 of file commit_options.h.

◆ return_stats()

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

Whether the CommitResult should contain CommitStats.

Definition at line 46 of file commit_options.h.

◆ set_request_priority()

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

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

Definition at line 49 of file commit_options.h.

◆ set_return_stats()

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

Set whether the CommitResult should contain CommitStats.

Definition at line 40 of file commit_options.h.

◆ set_transaction_tag()

CommitOptions& google::cloud::spanner::v1::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.

Definition at line 64 of file commit_options.h.

◆ transaction_tag()

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

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

Definition at line 71 of file commit_options.h.