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

Fix dbrestore on SQLite #383

Merged
merged 14 commits into from
Aug 23, 2024
Merged

Fix dbrestore on SQLite #383

merged 14 commits into from
Aug 23, 2024

Conversation

Lokkook
Copy link
Contributor

@Lokkook Lokkook commented Feb 11, 2021

Adding @rgaiacs changes about restoring to sqlite db with newlines

Bug fix

Description

This change fix a pb when restoring fields that contains newlines.

Adding @rgaiacs changes about restoring to sqlite db with newlines
@johnthagen
Copy link
Contributor

Related to #254 #258

@codecov
Copy link

codecov bot commented Apr 27, 2022

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.22%. Comparing base (8f1307e) to head (3106325).
Report is 13 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #383      +/-   ##
==========================================
- Coverage   91.40%   91.22%   -0.19%     
==========================================
  Files          19       19              
  Lines         873      912      +39     
  Branches      157      164       +7     
==========================================
+ Hits          798      832      +34     
- Misses         40       43       +3     
- Partials       35       37       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Archmonger Archmonger changed the title Update sqlite.py Fix SQLite dbrestore support Apr 28, 2022
@Archmonger Archmonger added bug Bugs that need to get fixed. db/sqlite high priority Priority issues labels Apr 28, 2022
@Archmonger Archmonger changed the title Fix SQLite dbrestore support Fix dbrestore on SQLite Apr 29, 2022
@Archmonger Archmonger marked this pull request as draft April 29, 2022 07:50
@Archmonger
Copy link
Contributor

Archmonger commented Apr 29, 2022

@johnthagen You mentioned something about the functional tests on this repo being iffy. Do you think that might be the reason why the test_create_dump_with_newline in this PR doesn't appear to run (according to the codecov hits)?

Unrelated note, I confirmed at least one issue on Windows appears to be related to gpg support. See dbbackup/tests/utils/add_public_gpg.

@johnthagen
Copy link
Contributor

You mentioned something about the functional tests on this repo being iffy.

I don't fully recall.

Unrelated note, I confirmed at least one issue on Windows appears to be related to gpg support.

Maybe *nix specific tests like gpg could be marked as skipped on Windows: https://docs.pytest.org/en/7.1.x/how-to/skipping.html#skipping-test-functions

@Archmonger
Copy link
Contributor

I'd need to confirm whether they should be skipped or not. It's very possible these tests failing is an indication that encryption support is broken on Windows.

@Archmonger Archmonger linked an issue Aug 22, 2024 that may be closed by this pull request
@Archmonger
Copy link
Contributor

@Lokkook @rgaiacs Are either of you interested in resolving the merge conflicts on this PR?

@rgaiacs
Copy link
Contributor

rgaiacs commented Aug 23, 2024

I have been working with Django in the last couple of years. Sorry for not be able to resolve the conflicts.

@Lokkook Lokkook marked this pull request as ready for review August 23, 2024 20:54
@Lokkook
Copy link
Contributor Author

Lokkook commented Aug 23, 2024

@Lokkook @rgaiacs Are either of you interested in resolving the merge conflicts on this PR?

Hello ! I did it. I hope I did it well :) Tell me !

@Archmonger
Copy link
Contributor

This can be merged after hitting full codecov. Seems like there's two logical branches that aren't being tested.

if line_str.startswith("INSERT") and not line_str.endswith(");\n"):
    sql_is_complete = False
    continue
if not sql_is_complete and line_str.endswith(");\n"):
    sql_is_complete = True

Lokkook and others added 2 commits August 23, 2024 23:17
Adding test to restore a dump with a field containing newline
Copy link
Contributor

@Archmonger Archmonger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, thank you for the PR!

@Archmonger Archmonger merged commit bc74b87 into jazzband:master Aug 23, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bugs that need to get fixed. db/sqlite high priority Priority issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't restore database if field has a line break
4 participants