Skip to content
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 missing spanner config properties #152

Merged
merged 4 commits into from
Jun 28, 2023

Conversation

rahul2393
Copy link
Collaborator

@rahul2393 rahul2393 commented Jun 1, 2023

  • Update all deps
  • Add support of setting rpcPriority
  • Add support of setting numChannels
  • Add support of setting databaseRole
  • Add support of setting optimizerVersion
  • Add support of setting optimizerStatisticsPackage

@rahul2393 rahul2393 requested a review from a team as a code owner June 1, 2023 06:00
@rahul2393 rahul2393 force-pushed the add_missing_connection_properties branch from 531412b to aebaa09 Compare June 2, 2023 06:45
driver.go Outdated
default:
priority = spannerpb.RequestOptions_PRIORITY_UNSPECIFIED
}
config.ReadOptions = spanner.ReadOptions{Priority: priority}
Copy link

@harshachinta harshachinta Jun 5, 2023

Choose a reason for hiding this comment

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

Should we assign a default ReadOptions when creating config something like spanner.ReadOptions{} and then just assign user configured priority here like config.ReadOptions.Priority = priority, instead of overwriting ReadOptions?
Otherwise when user wants to configure RequestTag in ReadOptions it gets overwritten.
Same for others also TransactionOptions and QueryOptions

Correct me if i am missing something here.

Choose a reason for hiding this comment

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

I guess we can directly do config.ReadOptions.Priority = priority because config.ReadOptions will be having default ReadOptions property set by default and will not be nil.

driver.go Outdated
@@ -46,13 +47,22 @@ const userAgent = "go-sql-spanner/1.0.1"
// 3. (Optional) Parameters: One or more parameters in the format `name=value`. Multiple entries are separated by `;`.
// The supported parameters are:
// - credentials: File name for the credentials to use. The connection will use the default credentials of the
// environment if no credentials file is specified in the connection string.
// environment if no credentials file is spec`ified in the connection string.

Choose a reason for hiding this comment

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

Suggested change
// environment if no credentials file is spec`ified in the connection string.
// environment if no credentials file is specified in the connection string.

Copy link

@harshachinta harshachinta left a comment

Choose a reason for hiding this comment

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

LGTM

@rahul2393 rahul2393 merged commit c6bda23 into main Jun 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants