zeroshade commented on code in PR #2558:
URL: https://github.com/apache/arrow-adbc/pull/2558#discussion_r1972137682


##########
go/adbc/driver/snowflake/driver.go:
##########
@@ -170,19 +171,30 @@ func quoteTblName(name string) string {
        return "\"" + strings.ReplaceAll(name, "\"", "\"\"") + "\""
 }
 
+type DriverOption func(*gosnowflake.Config) error
+
+func WithTransporter(transporter http.RoundTripper) DriverOption {
+       return func(cfg *gosnowflake.Config) error {
+               cfg.Transporter = transporter
+               return nil
+       }
+}
+
 type driverImpl struct {
        driverbase.DriverImplBase
+
+       opts []DriverOption
 }
 
 // NewDriver creates a new Snowflake driver using the given Arrow allocator.
-func NewDriver(alloc memory.Allocator) adbc.Driver {
+func NewDriver(alloc memory.Allocator, opts ...DriverOption) adbc.Driver {

Review Comment:
   yea, I'd be more in favor of a `NewDatabaseWithOptions` or something to that 
extent than expanding `NewDriver`, like the linked PR.
   
   > Do you think there's a chance this could be implemented for ADBC 17?
   
   If you update this PR in that pattern and we get it merged, then yes :) haha
   
   >  (Or if we think it will be useful outside of Snowflake, add a DriverExt 
interface that does the same thing?)
   
   I don't think there's a way to do this in a generic way such as a 
`DriverExt` as it would require different option types per driver. So being 
able to cast an `adbc.Driver` to a `*snowflake.Driver` to get access to the 
`NewDatabaseWithOptions` method seems fine. 



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to