Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: specify the database to pull from #171

Open
mjankowski opened this issue May 23, 2019 · 7 comments
Open

Feature request: specify the database to pull from #171

mjankowski opened this issue May 23, 2019 · 7 comments

Comments

@mjankowski
Copy link
Contributor

mjankowski commented May 23, 2019

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.

@geoffharcourt
Copy link
Collaborator

This is a great idea, I'm hoping to work on it this month.

@geoffharcourt
Copy link
Collaborator

@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.

@mjankowski
Copy link
Contributor Author

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.

@mjankowski
Copy link
Contributor Author

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.

@geoffharcourt
Copy link
Collaborator

Yeah, I think without that we're going to be reduced to a lot of JSON and stdout parsing that will add fragility.

@geoffharcourt
Copy link
Collaborator

@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.

@jakemumu
Copy link

jakemumu commented Oct 7, 2022

would love to see this feature added still <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants