-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a helper function for connecting to Redshift #879
Conversation
Test failures seem unrelated. |
Yup, failures are unrelated and addressed in #876! No worries there. |
029888d
to
2af0891
Compare
This seems to work as expected with this code.
I do need to specify the region otherwise, I get this error: |
2af0891
to
0b5ec69
Compare
Some checks are failing due to #882. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stellar. Thanks for making this happen!
unname(val) | ||
} | ||
|
||
find_default_driver <- function(paths, fallbacks, label, call = caller_env()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Digging this refactor.
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 with `odbc::databricks()` and `odbc::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. Signed-off-by: Aaron Jacobs <[email protected]>
0b5ec69
to
1606f1e
Compare
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.