using ::google::cloud::StatusOr;
namespace spanner = ::google::cloud::spanner;
std::int64_t rows_inserted;
auto commit_result = client.Commit(
[&client, &rows_inserted](
auto insert = client.ExecuteDml(
std::move(txn),
"INSERT INTO Singers (SingerId, FirstName, LastName)"
" VALUES (10, 'Virginia', 'Watson')"));
if (!insert) return insert.status();
rows_inserted = insert->RowsModified();
});
if (!commit_result) {
throw std::runtime_error(commit_result.status().message());
}
std::cout << "Rows inserted: " << rows_inserted;
Represents a potentially parameterized SQL statement.
The representation of a Cloud Spanner transaction.
std::vector< Mutation > Mutations
An ordered sequence of mutations to pass to Client::Commit() or return from the Client::Commit() muta...
Contains all the Cloud Spanner C++ client types and functions.