Open mjankowski opened 5 years ago
This is a great idea, I'm hoping to work on it this month.
@mjankowski this turns out to be not straightforward at all. heroku pg:backups:url
, which is how we currently fetch URLs, can take a backup ID, but it can't take a database name (unlike many of the other pg
subcommands). We would certainly benefit from doing this, so I'd like to see it happen, but I think it requires a significant reworking of how we get backup URLs.
Yeah... we'd need something like -- use pg:backups
, parse out the lines, find the first one matching the correct DB name, get the backup ID for that, request the URL for that backup ID, etc. Sort of clunky compared to current for sure.
I wonder if the Heroku CLI maintainers would feel about a request to add a --database
flag (or just the name as an argument) to the pg:backups
command, and have it return only backups on that db? That would let us more directly get the latest backup and/or ID for the DB we want.
Yeah, I think without that we're going to be reduced to a lot of JSON and stdout parsing that will add fragility.
@mjankowski we're no longer using Heroku for PG, so my work on this is not going to move nearly as fast. If there's a thoughtbuddy working on a project with followers who can work on this I'd love to see it make it into the library.
would love to see this feature added still <3
This came up in Slack today -- it would be PLEASANT if you could do something like
development restore production PINK
and parity would know to pull the most recent backup from the named DB in the relevant remote. Yes sir.In the use case being discussed there was a read-only follower set up which was backed up more regularly than the "main"
DATABASE_URL
db on the remote.