Skip to content
This repository has been archived by the owner on Dec 8, 2021. It is now read-only.

docs: add snippets for Commit() with a mutator or mutations #1374

Merged
merged 2 commits into from
Mar 14, 2020

Conversation

devbww
Copy link
Contributor

@devbww devbww commented Mar 14, 2020

This change is Reviewable

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Mar 14, 2020
Copy link
Contributor

@coryan coryan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this, maybe one of the snippets is a tad too long?

Reviewed 2 of 2 files at r1.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved


google/cloud/spanner/samples/samples.cc, line 1368 at r1 (raw file):

//! [START spanner_read_write_transaction]
void ReadWriteTransaction(google::cloud::spanner::Client client) {
  //! [commit-with-mutator]

FYI, this is a fairly long snippet, did you look at the rendered Doxygen? Consider a smaller mutator, maybe like the spanner_dml_write_then_read sample?

@codecov
Copy link

codecov bot commented Mar 14, 2020

Codecov Report

Merging #1374 into master will decrease coverage by 0.04%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1374      +/-   ##
==========================================
- Coverage   94.61%   94.57%   -0.05%     
==========================================
  Files         184      184              
  Lines       15221    15228       +7     
==========================================
  Hits        14402    14402              
- Misses        819      826       +7
Impacted Files Coverage Δ
google/cloud/spanner/samples/samples.cc 88.42% <ø> (-0.71%) ⬇️
google/cloud/spanner/client.h 100% <ø> (ø) ⬆️
google/cloud/spanner/results.h 95.83% <0%> (-4.17%) ⬇️
google/cloud/spanner/keys.h 100% <0%> (ø) ⬆️
google/cloud/spanner/internal/session.h 100% <0%> (ø) ⬆️
google/cloud/spanner/internal/transaction_impl.h 100% <0%> (ø) ⬆️
google/cloud/spanner/session_pool_options.h 100% <0%> (ø) ⬆️
google/cloud/spanner/database_admin_connection.h
...oogle/cloud/spanner/internal/instance_admin_stub.h
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 153a2d4...6a042df. Read the comment docs.

Copy link
Contributor Author

@devbww devbww left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved


google/cloud/spanner/samples/samples.cc, line 1368 at r1 (raw file):

Previously, coryan (Carlos O'Ryan) wrote…

FYI, this is a fairly long snippet, did you look at the rendered Doxygen? Consider a smaller mutator, maybe like the spanner_dml_write_then_read sample?

Yes, I looked, and it didn't seem to bad. But, smaller is better.

I had tried to avoid ExecuteDml(), but I guess there is no good reason for that. So then, the spanner_dml_standard_update looks even simpler. Thanks.

Copy link
Contributor

@coryan coryan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 1 of 1 files at r2.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

@devbww devbww merged commit 375493d into googleapis:master Mar 14, 2020
@devbww devbww deleted the snippets branch March 14, 2020 15:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants