Skip to content

Docs: Flight SQL Driver Go Usage documentation is out of date #2354

@NightTrain

Description

@NightTrain

What feature or improvement would you like to see?

Looks like the Go usage for the Flight SQL Driver is a bit out of date:
https://arrow.apache.org/adbc/current/driver/flight_sql.html

import (
   "context"

   "github.com/apache/arrow-adbc/go/adbc"
   "github.com/apache/arrow-adbc/go/adbc/driver/flightsql"
)

var headers = map[string]string{"foo": "bar"}

func main() {
   options := map[string]string{
       adbc.OptionKeyURI: "grpc+tls://localhost:8080",
       flightsql.OptionSSLSkipVerify: adbc.OptionValueEnabled,
   }

   for k, v := range headers {
       options[flightsql.OptionRPCCallHeaderPrefix + k] = v
   }

   var drv flightsql.Driver
   db, err := drv.NewDatabase(options)
   if err != nil {
       // do something with the error
   }
   defer db.Close()

   cnxn, err := db.Open(context.Background())
   if err != nil {
       // handle the error
   }
   defer cnxn.Close()
}

Specifically var drv flightsql.Driver doesn't work in the latest version. Looks like this was last viable as of v0.7.0
https://pkg.go.dev/github.com/apache/arrow-adbc/go/[email protected]/driver/flightsql

Regardless using the NewDriver method works as intended:

import (
   "context"

   "github.com/apache/arrow-adbc/go/adbc"
   "github.com/apache/arrow-adbc/go/adbc/driver/flightsql"
)

var headers = map[string]string{"foo": "bar"}

func main() {
   options := map[string]string{
       adbc.OptionKeyURI: "grpc+tls://localhost:8080",
       flightsql.OptionSSLSkipVerify: adbc.OptionValueEnabled,
   }

   for k, v := range headers {
       options[flightsql.OptionRPCCallHeaderPrefix + k] = v
   }

   var alloc memory.Allocator
   drv := flightsql.NewDriver(alloc)
   db, err := drv.NewDatabase(options)
   if err != nil {
       // do something with the error
   }
   defer db.Close()

   cnxn, err := db.Open(context.Background())
   if err != nil {
       // handle the error
   }
   defer cnxn.Close()
}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions