-
Notifications
You must be signed in to change notification settings - Fork 0
Fix SQL syntax spacing in archive overwrite functionality and prevent database growth #29
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
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #29 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 1 1
Lines 60 60
Branches 4 4
=========================================
Hits 60 60 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-authored-by: johnpatek <31934875+johnpatek@users.noreply.github.com>
Co-authored-by: johnpatek <31934875+johnpatek@users.noreply.github.com>
Co-authored-by: johnpatek <31934875+johnpatek@users.noreply.github.com>
…T behavior Co-authored-by: johnpatek <31934875+johnpatek@users.noreply.github.com>
… unnecessary growth Co-authored-by: johnpatek <31934875+johnpatek@users.noreply.github.com>
CMakeLists.txt
Outdated
| ) | ||
| FetchContent_MakeAvailable(sqlite3) | ||
| # Use system SQLite3 instead of fetching | ||
| find_package(PkgConfig REQUIRED) |
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.
@copilot FetchContent is used for client projects that depend on this library please either revert this change when you are done or add a cmake option that allows the build system to use FetchContent and override the find_package call.
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.
You're absolutely right. I've reverted the CMakeLists.txt changes to use FetchContent for SQLite3 as originally intended, maintaining compatibility with client projects that depend on this library. The changes to use find_package were only needed for my testing environment. Fixed in e8f1a2d.
…_package Co-authored-by: johnpatek <31934875+johnpatek@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Final Solution:
Root Cause: The SQL query in
hyperpage::writer::store()had a syntax error due to missing space between concatenated string literals, not the multiline approach itself.Fix Applied:
"VALUES (?, ?, ?);" + "ON CONFLICT(path) DO UPDATE..."→ Creates:"VALUES (?, ?, ?);ON CONFLICT..."(missing space)"VALUES (?, ?, ?) " + "ON CONFLICT(path) DO UPDATE..."→ Creates:"VALUES (?, ?, ?) ON CONFLICT..."(proper space)Key Points:
Database Growth Prevention:
Added
archive_size_no_growth_testwhich verifies that overwriting with identical content multiple times does not increase database file size. Test results show 0% growth when usingON CONFLICT ... DO UPDATEsyntax.Build System Compatibility:
Reverted CMakeLists.txt changes to maintain FetchContent approach for SQLite3, ensuring compatibility with client projects that depend on this library.
Verification:
overwrite_testvalidates the fix works correctly ✅hyperpacktool confirms real-world scenario works ✅Fixes #28.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.