I'm hosting my application on Heroku with a Postgres DB addon. Reading the doc the credentials are rotated frequently so you need to access the DATABASE_URL
env variable to connect to it, but Heroku exposes it only at runtime.
My problem is that I use sqlx
in my Rust application, so I need the DB URL at compile time. I could do heroku config:get DATABASE_URL
in the GH Actions workflow and pass it as an arg to heroku container:push
, but I don't want to expose the credentials.
So how can access this variable at build time in a safe manner?