golang-samples
golang-samples copied to clipboard
feat(spanner): add samples for database roles
Adds samples with database roles on requests.
I'll work on a sample for ListDatabaseRoles soon.
Here is the summary of changes.
You are about to add 4 region tags.
- spanner/spanner_snippets/spanner/spanner_add_and_drop_database_role.go:17, tag
spanner_add_and_drop_database_role - spanner/spanner_snippets/spanner/spanner_enable_fine_grained_access.go:17, tag
spanner_enable_fine_grained_access - spanner/spanner_snippets/spanner/spanner_list_database_roles.go:17, tag
spanner_list_database_roles - spanner/spanner_snippets/spanner/spanner_read_data_with_database_role.go:17, tag
spanner_read_data_with_database_role
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
@varuncnaik Looks like there are some compilation errors caused by missing types. You'll need to upgrade the underlying client if these are new methods and types you're using.
@varuncnaik Still seeing some compilation errors. Let me know if you'd like some help with this. Otherwise, I'll assume you'll ping me when you're ready for another look.
Looks like we're still missing some types:
# github.com/GoogleCloudPlatform/golang-samples/spanner/spanner_snippets
spanner_snippets/snippet.go:825:3: unknown field 'DatabaseRole' in struct literal of type "cloud.google.com/go/spanner".ClientConfig
# github.com/GoogleCloudPlatform/golang-samples/spanner/spanner_snippets/spanner
spanner_snippets/spanner/spanner_read_data_with_database_role.go:32:3: unknown field 'DatabaseRole' in struct literal of type "cloud.google.com/go/spanner".ClientConfig
@varuncnaik Want some help finishing this? We've had this open for quite awhile now.
Hi @enocom, we're aware of the missing types. In my local setup for this PR, I'm editing my go.mod file to replace cloud.google.com/go/spanner with my local copy of https://github.com/googleapis/google-cloud-go/pull/5701.
We plan to merge both of these PRs around the time that Cloud Spanner fine-grained access control becomes generally available. Until then, I am periodically merging the latest main into both PRs and making sure that tests pass locally. CC @rahul2393, in case the two of you want to exchange information over DM.
Sounds good. Just ping me when you're ready and we can merge this.