Closed JohnBakhmat closed 3 months ago
Thank you
Oh alright i found where the issue is. When pgo tries to parse url protocol out of string, it asserts that it is postgres
where as in postgres docs
https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING
it is stated that it can be either postgres
or postgresql
.
The problematic line is located at https://github.com/lpil/pgo/blob/1f2307b13ed46c1ef4ea7967729e34dd7423132b/src/gleam/pgo.gleam#L89
I made a pr https://github.com/lpil/pgo/pull/25, if you want some changes im at your service :)
Hi, so ive been trying to connect to db using pgo.url_config, and it seams to be denying a valid string.
Here is how i use this function https://github.com/JohnBakhmat/shorty_gleam/blob/68fea8d78fae847a1efa779dc80070a7939754a2/src/app/db.gleam#L7
Im loading connection string from .env using envoy https://github.com/JohnBakhmat/shorty_gleam/blob/68fea8d78fae847a1efa779dc80070a7939754a2/src/app/router.gleam#L38
And the connection string im trying to use is
postgresql://postgres:supfuckers@127.0.0.1:5432/postgres
I thought maybe i didnt provide username and password correctly but there is no example on how to do it correctly in gleam/uri docs https://hexdocs.pm/gleam_stdlib/gleam/uri.html#parse. the string does work when using
psql
tool