-
Notifications
You must be signed in to change notification settings - Fork 54
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
Request to accept the username and password as two different arguments for db.open function. #33
Comments
Hi there! If you're using special characters in your connection string, you need to URL encode them first. You can use the builtin const pass = encodeURIComponent('pass[@#$%^&]');
const db = sql.open('postgres', `postgres://user:${pass}@127.0.0.1:5432/postgres?sslmode=disable`); I confirmed this works on a local Postgres instance, so it should work with AWS RDS as well. So we don't need to add separate arguments for this, even though it wouldn't be a breaking change. |
Hi, Thanks for the quick response. Unfortunately, I could not make it work either with The only observed difference so far I can see is that I would prefer to use my local build with username and password as different arguments on the Thanks again for your feedback. I really appreciate it. |
@vamsidarbhamulla Sorry to read that, but I think there's another reason you're getting the Can you test with plain Postgres and not RDS, to confirm if it's an RDS issue? I run a Docker container with:
The reason I'm reluctant to do this change is because You could just keep using your fork, but I don't see a reason why |
Hi @imiric - I did test it with plain postgres docker setup and I'm able to interact with the local docker DB. Not sure what exactly is the issue with RDS setup and the I totally agree with the reasoning behind not modifying the current code changes. I will keep using the fork. Thanks for the response. |
Hi,
I'm trying to connect to aws rds based postgres instance with a password string containing a good number of special characters.
I did observe an error as net/url: invalid userinfo while building the xk6-sql extension and providing the connection string.
After a bit of research I'm able to fix my issue with a local build of xk6-sql by following the below two suggestions:
I'm pretty new to golang ecosystem so requesting to get the same code changes on the actual repo if it makes sense.
The text was updated successfully, but these errors were encountered: