kj-9/sqltools-redshift-driver

Connection String Parser incorrectly identifies Host for JDBC Connection Strings

Opened this issue · 5 comments

The driver string parser incorrectly identifies the server / host in a given connection string. When parsing the following connection string: jdbc:redshift:iam://<host>:<port> the driver returns an ENOTFOUND error indication that server "redshift" could not be found:

image
ERROR (ext): ERROR: Error opening connection getaddrinfo ENOTFOUND redshift, {"code":-32001,"data":{"driver":"AWS Redshift","driverOptions":{}}}

Similarly, if one removes the 'jdbc' portion and uses the connection string redshift:iam://<host>:<port>, the driver responds that host 'iam' does not exist:
image

Essentially, the parser picks out whatever is the 2nd portion of the string as the Host, regardless of the string components

kj-9 commented

Thanks for reporting the Issue.

sqltools-redshift-driver using the pg library to connect to Redshift, not just to parse connection strings. It appears that the pg library itself does not support IAM authentication for Redshift.

I'm looking for other connection methods, but it doesn't seem to be easy: the python connector and jdbc jar files are published and supported by AWS, but there is no similar node.js connector.

It would be better to run the jar file from javascript, but I have not found a suitable node.js jdbc wrapper. node-jdbc looked promising, but it is not actively maintained.

I will continue to look into this, but there doesn't seem to be an easy solution at the moment.

any update on this?

@kj-9 I am wondering if there is any new update on this?
Would love to help contribute, but I am new to this. It will be great if you can show me how I can do some test and development.

kj-9 commented

As I mentioned, there is still no easy way to make redshift IAM connections in javascript, and there is no hope of resolving this issue.

In order to keep it as simple as possible, I am not planning to use workrounds to solve this problem, but if you have any proposals, I would welcome them.

@yanjunlim
Thanks! Can you start from here?