Skip to content

Conversation

simolus3
Copy link
Contributor

@simolus3 simolus3 commented Jun 22, 2025

This fixes two instances of a pending statement being busy after a powersycnc_control invocation, which would make some database operations (like a vacuum) impossible.

  1. In StorageAdapter.now, reset the statement after running it.
  2. Refactor StorageAdapter.local_progress to not use streaming iterators (they're tricky here because closing them can't return an error code). Instead, we make the prepared statement public and add a method to step and interpret typed results.

To test this across platforms, I've adopted the sqlite3_native_assets package in tests. It relies on native assets to compile and link SQLite instead of using the one from the operating system. This allows us to enable the statement vtab, used in tests to assert no statements remain busy in the end. Actually I'll probably have to revert that because it means we can't test with a stable SDK. Not sure how we'd test regressions then.

rkistner
rkistner previously approved these changes Jun 23, 2025
@simolus3 simolus3 force-pushed the fix-trailing-statements branch from 29f4d35 to fdda3a2 Compare June 23, 2025 18:39
@simolus3 simolus3 requested a review from rkistner June 23, 2025 18:39
@simolus3 simolus3 merged commit 8de98da into main Jun 24, 2025
21 checks passed
@simolus3 simolus3 deleted the fix-trailing-statements branch June 24, 2025 00:13
@simolus3 simolus3 mentioned this pull request Jun 24, 2025
10 tasks
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 this pull request may close these issues.

2 participants