-
Notifications
You must be signed in to change notification settings - Fork 23
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
Don't overwrite existing dump file by default, make database name clearer #1184
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
make database name output clearer
fantix
reviewed
Dec 4, 2023
…mp-file-by-default
mmastrac
approved these changes
Jul 12, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
msullivan
added a commit
to edgedb/edgedb
that referenced
this pull request
Jul 13, 2024
edgedb/edgedb-cli#1184 made dump refuse to overwrite files by default, which broke our dump tests. We could fix it by passing the flag to allow overwriting to the CLI, but it seems more natural to make a temp *directory* instead of overwriting a temp file.
msullivan
added a commit
to edgedb/edgedb
that referenced
this pull request
Jul 13, 2024
edgedb/edgedb-cli#1184 made dump refuse to overwrite files by default, which broke our dump tests. We could fix it by passing the flag to allow overwriting to the CLI, but it seems more natural to make a temp *directory* instead of overwriting a temp file.
msullivan
added a commit
to edgedb/edgedb
that referenced
this pull request
Jul 13, 2024
edgedb/edgedb-cli#1184 made dump refuse to overwrite files by default, which broke our dump tests. We could fix it by passing the flag to allow overwriting to the CLI, but it seems more natural to make a temp *directory* instead of overwriting a temp file.
msullivan
added a commit
to edgedb/edgedb
that referenced
this pull request
Aug 21, 2024
edgedb/edgedb-cli#1184 made dump refuse to overwrite files by default, which broke our dump tests. We could fix it by passing the flag to allow overwriting to the CLI, but it seems more natural to make a temp *directory* instead of overwriting a temp file.
msullivan
added a commit
to edgedb/edgedb
that referenced
this pull request
Aug 21, 2024
edgedb/edgedb-cli#1184 made dump refuse to overwrite files by default, which broke our dump tests. We could fix it by passing the flag to allow overwriting to the CLI, but it seems more natural to make a temp *directory* instead of overwriting a temp file.
msullivan
added a commit
to edgedb/edgedb
that referenced
this pull request
Aug 21, 2024
edgedb/edgedb-cli#1184 made dump refuse to overwrite files by default, which broke our dump tests. We could fix it by passing the flag to allow overwriting to the CLI, but it seems more natural to make a temp *directory* instead of overwriting a temp file.
msullivan
added a commit
to edgedb/edgedb
that referenced
this pull request
Aug 21, 2024
edgedb/edgedb-cli#1184 made dump refuse to overwrite files by default, which broke our dump tests. We could fix it by passing the flag to allow overwriting to the CLI, but it seems more natural to make a temp *directory* instead of overwriting a temp file.
msullivan
added a commit
to edgedb/edgedb
that referenced
this pull request
Aug 22, 2024
edgedb/edgedb-cli#1184 made dump refuse to overwrite files by default, which broke our dump tests. We could fix it by passing the flag to allow overwriting to the CLI, but it seems more natural to make a temp *directory* instead of overwriting a temp file.
msullivan
added a commit
to edgedb/edgedb
that referenced
this pull request
Aug 22, 2024
edgedb/edgedb-cli#1184 made dump refuse to overwrite files by default, which broke our dump tests. We could fix it by passing the flag to allow overwriting to the CLI, but it seems more natural to make a temp *directory* instead of overwriting a temp file.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Having a database dump instantaneously overwrite any existing files of the same name has always made me a bit nervous and I think we should require the user to add an
--overwrite-existing
to the command to make this behaviour explicit. Some current users may be annoyed butedgedb dump --help
will quickly show the option to overwrite and I think it's best to get this out of the way now, much better than a panicked "I mistakenly overwrote some incredibly crucial file and is there any way to restore it...?" issue later on.The current behaviour calls create() which makes an OpenOptions with the following parameters set:
https://doc.rust-lang.org/src/std/fs.rs.html#394
So keep that in case of overwrite-existing, and use .create_new() otherwise.
When using
--all
I think automatic overwriting is fine as is since the user has to specify a directory, and the PR adds a note to that effect that using --all will have this effect. Also dump_all() is used when upgrading an instance so best to leave that untouched.Also noticed that having the default database be edgedb makes the output a bit unclear sometimes:
"Starting dump for edgedb", "Finished dump for edgedb" and "Database edgedb dump" all look like it might be referring to EdgeDB in general. So just add some ticks around the database name.