How to discover DATABASE_URL when using sqlx local...
# help
s
Hey, I want to use sqlx's query_as! macro which requires a database url to be set. When I 'cargo shuttle run' locally I can see a postgres container has spun up and I can get the db name and port of the local postgres from a docker inspect, but how do I find the user name and password? Or did I do it wrong?
i
As a workaround can't you host a local db and put it in as a local uri?
I think it gives you the database url once it starts up

https://cdn.discordapp.com/attachments/1112336882043465801/1112389160393769041/image.png

I just connected to it with psql
a
the easiest way to do this is to declare the macro and then run locally before adding any queries since then it'll provision the db for you
s
Doh! of course, Thank you