Am trying to perform migration on github action but i cant directly connect to the postgres instance on fly because of the IP. So i need to connect to it through poxy flyctl proxy 5432 -a <postgres-app-name> . The step of connecting to postgres on github action works fine but the issue is that when connection the posgres is established, the terminal remains open this makes the steps on github action to run for ever.
Is there any way to run the connection in the background so i can run other commands.
or other way of connecting to postgres with keeping the terminal open ?
I wasn’t aware of release_command - sounds perfect. Though the docs say that the command runs in a temporary VM. I will need some context, specifically the sqlx-cli, to invoke the migration.
And specifically for sqlx-cli - it expects the DATABASE_URL env var, but the DATABASE_URL that the Fly App uses is a bit different. SQLx expects the dbname parameter as part of the URL, whereas the Fly App connect directly to the correct dbname.
Is there an idiomatic way of working that out?