-
Notifications
You must be signed in to change notification settings - Fork 93
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
feat: add support for QueryOptions #846
Conversation
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.
LGTM
If you can update the PR description to:
- List the precedence
- Mention the env var name
that would be great.
proto/spanner.d.ts
Outdated
@@ -1146,16 +1146,19 @@ export namespace google { | |||
paramTypes?: ({ [k: string]: google.spanner.v1.IType }|null); | |||
|
|||
/** ExecuteSqlRequest resumeToken */ | |||
resumeToken?: (Uint8Array|null); | |||
resumeToken?: (Uint8Array|string|null); |
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.
I assume these are auto-generated changes?
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.
Yes, although it could be that this change is only 'generated' because of the way I manually generated the proto changes. It should however not make any difference for this PR once the actual proto change has been merged.
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.
It seems that the generated code change is on master so I think you should be able to revert this file.
Done. |
Thanks for the changes. One more request @olavloite, would you be able to upload any samples you have? I'm not sure whether it should be in this PR or in a separate one but I'll let you decide. |
I've added the samples to this PR. |
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.
Thanks @olavloite. Please merge in the change after you've resolved the merge conflicts.
1ff18c7
to
220d238
Compare
Adds the ability to set
QueryOptions
when running Cloud Spanner queries. For now, only setting thequery_optimizer_version
is added.QueryOptions can be configured through the following mechanisms:
SPANNER_OPTIMIZER_VERSION
environment variable.Database
level usingspanner.instance('instance-name').database('database-name', sessionPoolOptions, queryOptions)
.ExecuteSqlRequest.queryOptions
.If the options are configured through multiple mechanisms then:
Database
level.Database
or environment variable level.If no options are set, the optimizer version will default to: