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

Enhancement: Warning message when database url value not present #14

Open
rdhzl opened this issue Jan 6, 2023 · 0 comments · May be fixed by #18
Open

Enhancement: Warning message when database url value not present #14

rdhzl opened this issue Jan 6, 2023 · 0 comments · May be fixed by #18

Comments

@rdhzl
Copy link

rdhzl commented Jan 6, 2023

Hello,

First off, handy utility. It saves me quite a bit of time when working on schema/data migrations. So, thank you!

I've been using a toml file for configuration, which I keep in my user directory. I managed to shoot myself in the foot today by doing the following:

  1. Capturing a snapshot when I was outside of that dir, thinking that I was capturing the desired db (when really I guess I captured some top-level Postgres database)
  2. Attempting to restore in the directory I captured in. This in an of itself yields an error like so:
dslr restore test2 
Failed to restore snapshot
zero-length delimited identifier at or near """"
LINE 1: DROP DATABASE ""
                      ^
  1. Not thinking "Oh I captured garbage, be careful not to restore garbage" I navigated back to my home directory and ran the restore again and restored garbage over my db.

So, user error for sure, but I wonder if making it clear to people that the URL value is empty when running operations would save people from similar issues.

I'm not sure if DSLR will check the path for a toml file, but wonder if that would be a worthwhile enhancement. The DATABASE_URL environment variable is generic enough that I am hesitant to use it for config.

Thanks again.

tvuotila added a commit to tvuotila/DSLR that referenced this issue Aug 30, 2023
Database name is empty if database url is not defined
Fixes mixxorz#14
@tvuotila tvuotila linked a pull request Aug 30, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant