go-gorm / bigquery

BigQuery golang sql driver/GORM dialect
MIT License
41 stars 23 forks source link

Add emulator support #11

Closed mihaitodor closed 1 year ago

mihaitodor commented 1 year ago

I'd like to use this driver to run queries against https://github.com/goccy/bigquery-emulator, which is a new emulator for BigQuery.

Based on some quick tests, in addition to the scopes query parameter which was added in #10, two new parameters are required which correspond to option.WithoutAuthentication() (true when set, false otherwise) and option.WithEndpoint() (string). For the endpoint one, I tested passing in http://0.0.0.0:9050 and that worked just fine.

Please let me know if this addition interests you. Happy to send a PR.

Mistic92 commented 1 year ago

Wow, I was just looking for it, thanks for contribution. Can you add example usage of it to readme too?

mihaitodor commented 1 year ago

@Mistic92 Good point, I should've done that... I'll add it to my list, since I also want to add this driver to https://benthos.dev for the sql_select / sql_insert / sql_raw components. Currently, it only has gcp_bigquery_select which isn't very flexible and I want people to be able to also stream data to BigQuery using Benthos.