Add a helper function for connecting to Redshift #879
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit introduces a new
odbc::redshift()
function intended to help setting up connections to AWS Redshift, especially when using IAM credentials. It generally follows the pattern established withodbc::databricks()
andodbc::snowflake()
.Note that finding IAM credentials is outsourced to
paws.common
. Some Redshift ODBC drivers (there are a few of them) can handle AWS profiles or IAM role assumption, and I did have an earlier version of this commit that did this work manually; unfortunately the supported parameters depend not only on the driver, but also the driver version, and it quickly became a mess.So: using
paws.common
here allows us to be very driver version-agnostic, and ensures we support as wide a number of IAM setups as possible.Note that I also refectored some of automatic driver discover for Databricks and Snowflake into its own helper utility so we could use the same logic for Redshift, and fixed some grammar issues in their respective error messages.
Unit tests are included.
Part of #878.