How should I provide the database
# spicedb
c
How should I provide the database pasword if it contains special characters?
Copy code
sh
spicedb migrate head --datastore-engine=postgres --datastore-conn-uri='postgres://user:-.$[_@localhost:5432/spicedb?sslmode=disable'

7:25AM ERR terminated with errors error="unable to create migration driver for postgres: cannot parse `postgres://user:xxxxxx@localhost:5432/spicedb?sslmode=disable`: failed to parse as URL (net/url: invalid userinfo)"
y
lemme make an issue - it seems like it should be possible to urlencode this somewhere to let it be valid
I did some research on this and it looks like the postgres recommendation is that you urlencode a URI that contains special characters: https://github.com/authzed/spicedb/issues/2568#issuecomment-3292655794
c
Thanks. I probably will come back to this issue later to find out the difference between providing the uri as an agrument
--datastore-conn-uri=uri
and as an env variable
DATASTORE_CONN_URI=uri
The strange thing is when my migration script works with
DATABASE_URL='postgres://user:some_special_chars@localhost:5432/otherdb'
. For now I just changed the password to workaround it.
y
i think they're passed pretty directly to the underlying pgx library
so it'll be whatever the behavior there is
3 Views