Skip to content
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

Can't connect to db url that has username + password #2217

Open
ColtonIdle opened this issue Jul 20, 2024 · 1 comment
Open

Can't connect to db url that has username + password #2217

ColtonIdle opened this issue Jul 20, 2024 · 1 comment

Comments

@ColtonIdle
Copy link

New to backend dev, but im trying to use hikari and I can get a connection if I do

        val ds = HikariDataSource()
        ds.driverClassName = "org.postgresql.Driver"
        ds.jdbcUrl = "jdbc:postgresql://viaduct.proxy.rlwy.net:1234/railway"
        ds.username = "postgres"
        ds.password = "password"

But (im using railway as my host) railway has a env variable for the url and it comes through as a format of

postgresql://postgres:[email protected]:1234/railway
so I tried doing

    val ds = HikariDataSource()
    ds.driverClassName = "org.postgresql.Driver"
    ds.jdbcUrl = "jdbc:"+ THE_ENV_VAR

but the connection fails. Any ideas if this is because hiraki can't handle both username and password in the jdbc url?

@ColtonIdle
Copy link
Author

postgres is the db username

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant