xo / usql

Universal command-line interface for SQL databases
MIT License
8.82k stars 346 forks source link

Fix FlightSQL driver #407

Closed srebhan closed 1 year ago

srebhan commented 1 year ago

Not all FlightSQL backends support SELECT version() so we should not make any assumptions. The same holds for comment support. This PR registers an empty driver to prevent errors when connecting.

kenshaw commented 1 year ago

@srebhan I thought that might be the case. Instead of not doing any version string, I'd prefer if this just ignore the error and return "FlightSQL <unknown>".

kenshaw commented 1 year ago

@srebhan for what it's worth, the only container image I could find was the docker.io/voltrondata/flight-sql image. If you have a better/more useful image to use, I'd gladly change my testing to using it.

srebhan commented 1 year ago

@kenshaw currently there is no docker image available for the database I'm testing against. Will let you know once this changes.

kenshaw commented 1 year ago

@srebhan I apologize; I forgot that I had the drivers package do a default version query when no Version hook was provided to the drivers.Driver definition. As such, your original submission of just drivers.Driver{} would have been the most correct. Sorry! It's been about 6 years since I originally wrote that, and details escaped me.

srebhan commented 1 year ago

@kenshaw no worries! We are all humans... Except for the machines... and the animals. ;-)