trinodb / trino-go-client

Go client for Trino
Apache License 2.0
135 stars 63 forks source link

feat: support custom request headers #91

Closed patrickdemers6 closed 6 months ago

patrickdemers6 commented 1 year ago

Depending on the Trino server configuration, the ability to pass custom headers on a per-request is incredibly valuable. Transaction ID, instrumentation ID, and Authorization headers to name a few. This adds the ability to set custom headers using a sql.Named parameter where the name has the prefix X-Header-.

Testing

  1. Unit test in trino_test.go.
  2. Manually validated with a local Trino server.

I signed CLA earlier today but it may not be in the system yet.

cla-bot[bot] commented 1 year ago

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Patrick Demers. This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email email@example.com
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails
cla-bot[bot] commented 1 year ago

Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to cla@trino.io. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla

cla-bot[bot] commented 1 year ago

Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to cla@trino.io. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla

nineinchnick commented 1 year ago

There's a similar discussion in the main Trino repository: https://github.com/trinodb/trino/pull/15826. I think it also applies here. I'd rather discuss specific use cases and keep Trino clients in multiple languages consistent.