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(go/adbc/driver/flightsql): allow passing arbitrary grpc dial options in NewDatabase #2563

Merged
merged 6 commits into from
Feb 27, 2025

Conversation

mariusvniekerk
Copy link
Member

Add a new database constructor NewDatabaseWithOptions to allow passing arbitrary user-specified grpc dial options.

This is useful for constructs like

driver := flightsql.NewDriver(memory.DefaultAllocator)
driver.NewDatabaseWithOptions(map[string]string{
		"uri": uri,
	},
	grpc.WithStatsHandler(otelgrpc.NewClientHandler())
)

which allows usage of the opentelemetry grpc instrumentation for example.

This also provides an escape valve for users that need the ability to use less commonly used grpc client features that we have not exposed via the string map args.

…ions in NewDatabase

Add a new database constructor NewDatabaseWithOptions to allow passing arbitrary user-specified grpc dial options.

This is useful for constructs like
```go
driver := flightsql.NewDriver(memory.DefaultAllocator)
driver.NewDatabaseWithOptions(map[string]string{
		"uri": uri,
	},
	grpc.WithStatsHandler(otelgrpc.NewClientHandler())
)
```

which allows usage of the opentelemetry grpc instrumentation for example.

This also provides an escape valve for users that need the ability to use less commonly used grpc client features that we have not exposed via the string map args.
@github-actions github-actions bot added this to the ADBC Libraries 17 milestone Feb 26, 2025
@@ -76,13 +77,23 @@ type driverImpl struct {
driverbase.DriverImplBase
}

type Driver interface {
Copy link
Member

Choose a reason for hiding this comment

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

add a docstring please

@zeroshade zeroshade merged commit 28a87ea into apache:main Feb 27, 2025
40 checks passed
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