F21 commented on a change in pull request #43: add Connector implementation
URL: https://github.com/apache/calcite-avatica-go/pull/43#discussion_r306253229
##########
File path: driver.go
##########
@@ -47,10 +47,18 @@ import (
// Driver is exported to allow it to be used directly.
type Driver struct{}
-// Open a Connection to the server.
-// See https://github.com/apache/calcite-avatica-go#dsn for more information
-// on how the DSN is formatted.
-func (a *Driver) Open(dsn string) (driver.Conn, error) {
+// Connector implements the driver.Connector interface
+type Connector struct {
+ additionalInfos map[string]string
+ additionalHeaders map[string]string
+}
+
+// NewConnector creates a new connector
+func NewConnector(additionalInfos, additionalHeaders map[string]string)
driver.Connector {
Review comment:
I think it should be `NewConnector(dsn string) driver.Connector`, following
the implementations of other drivers such as
[`go-mssqldb`](https://godoc.org/github.com/denisenkom/go-mssqldb#Driver.Open).
The user should then be able to update the properties of the connector since
the properties are public. This allows us to avoid needing to add more
arguments to the `NewConnector` method if we want to support other properties
in the future.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services