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 std::move(insert).status();
rows_inserted = insert->RowsModified();
});
if (!commit_result) throw std::move(commit_result).status();
std::cout << "Rows inserted: " << rows_inserted;
Represents a potentially parameterized SQL statement.
Definition: sql_statement.h:51
The representation of a Cloud Spanner transaction.
Definition: transaction.h:58
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