feat: Create a few code snippets as examples for using Spanner Graph in golang
Add a few code snippets to illustrate how to use Spanner Graph functionality in Golang. These examples resemble other snippets for how various other Spanner features can be used.
Fixes #4312
Checklist
- [x] I have followed Contributing Guidelines from CONTRIBUTING.MD
- [x] Tests pass:
go test -v ./..(see Testing) - [x] Code formatted:
gofmt(see Formatting) - [x] Vetting pass:
go vet(see Formatting) - [ ] These samples need a new API enabled in testing projects to pass (let us know which ones)
- [ ] These samples need a new/updated env vars in testing projects set to pass (let us know which ones)
- [ ] This sample adds a new sample directory, and I updated the CODEOWNERS file with the codeowners for this sample
- [ ] This sample adds a new Product API, and I updated the Blunderbuss issue/PR auto-assigner with the codeowners for this sample
- [x] Please merge this PR for me once it is approved
Here is the summary of changes.
You are about to add 9 region tags.
- spanner/spanner_snippets/spanner/spanner_create_database_with_property_graph.go:17, tag
spanner_create_database_with_property_graph - spanner/spanner_snippets/spanner/spanner_delete_graph_data.go:17, tag
spanner_delete_graph_data - spanner/spanner_snippets/spanner/spanner_dml_delete_graph_data.go:17, tag
spanner_delete_graph_data_with_dml - spanner/spanner_snippets/spanner/spanner_dml_insert_graph_data.go:17, tag
spanner_insert_graph_data_with_dml - spanner/spanner_snippets/spanner/spanner_dml_update_graph_data.go:17, tag
spanner_update_graph_data_with_dml - spanner/spanner_snippets/spanner/spanner_dml_update_graph_data_with_graph_query.go:17, tag
spanner_update_graph_data_with_graph_query_in_dml - spanner/spanner_snippets/spanner/spanner_insert_graph_data.go:17, tag
spanner_insert_graph_data - spanner/spanner_snippets/spanner/spanner_query_graph_data.go:17, tag
spanner_query_graph_data - spanner/spanner_snippets/spanner/spanner_query_graph_data_with_parameter.go:17, tag
spanner_query_graph_data_with_parameter
This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:
- [ ] Refresh this comment
🤖 I detect that the PR title and the commit message differ and there's only one commit. To use the PR title for the commit history, you can use Github's automerge feature with squashing, or use automerge label. Good luck human!
-- conventional-commit-lint bot https://conventionalcommits.org/
The new graph_snippet.go models spanner/spanner_snippets/snippet.go. I have tested this manually, but I am not sure where test code for the code in snippet.go is written, and similarly how graph_snippet.go should be set up with tests. Looking for some guidance on this. Thanks!
Gentle ping
Before we continue with this review, please verify that these samples are needed.
See the list of existing samples here: https://cloud.google.com/docs/samples?language=golang&product=cloudspanner
These samples address a new feature of Spanner - the ability to create and query property graphs.