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

Support for smart overwrite #35

Closed
denis-stepanov opened this issue Aug 31, 2022 · 1 comment · Fixed by #58
Closed

Support for smart overwrite #35

denis-stepanov opened this issue Aug 31, 2022 · 1 comment · Fixed by #58
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@denis-stepanov
Copy link
Owner

Current db-djv-pg export / import -o behavior is to delete the existing object of the same name at the target and create it again. Actually, both database and files know SHA1 hash of the object, so a bit smarter behavior would be to delete + create only if SHA1 hashes differ.

@denis-stepanov denis-stepanov added the enhancement New feature or request label Aug 31, 2022
@denis-stepanov denis-stepanov added this to the v1.5.0 milestone Sep 21, 2022
@denis-stepanov denis-stepanov self-assigned this Nov 8, 2022
@denis-stepanov denis-stepanov linked a pull request Nov 16, 2022 that will close this issue
@denis-stepanov
Copy link
Owner Author

Summary of implementation:

  • default behavior does not change (no overwrite);
  • -o option now checks SHA1 of source and target and refuses overwrite if they match. Previous behavior was unconditional overwrite;
  • new -O option implements unconditional overwrite.

These options are implemented on commands export, import and rename. The latter works in both DB and file modes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant