Expand C API coverage: reset/backup/blob I/O/error reporting#5
Merged
Conversation
…rappers to Statement
…rappers to Connection
…n interrupt/busy timeout/autocommit
…int_v2/autocheckpoint)
Code Coverage OverviewLanguages: Swift Swift / code-coverage/llvm-covThe overall coverage in the branch is 96%. The coverage in the branch is 97%. Show a code coverage summary of the most impacted files.
Code Coverage is in Public Preview. Learn more and provide us with your feedback. |
This file contains hidden or 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
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.
Summary
sqlite3_reset,sqlite3_clear_bindings, andsqlite3_expanded_sqltoStatement, allowing prepared statements to be reused instead of only finalized.sqlite3_result_error(block/final closures can nowthrow).Connection's close path tosqlite3_close_v2and addsqlite3_get_autocommit,sqlite3_busy_timeout, andsqlite3_interruptwrappers.IncrementalBlobwrapper around the incremental BLOB I/O API (sqlite3_blob_open/read/write/bytes/close/reopen).Backupwrapper around the online backup API (sqlite3_backup_init/step/finish/remaining/pagecount).Connection.journalMode/setJournalMode(_:)(viaPRAGMA journal_mode, since there's no dedicated C API for it) andwalCheckpoint(mode:database:)/setWALAutoCheckpoint(pageCount:)wrappingsqlite3_wal_checkpoint_v2/sqlite3_wal_autocheckpoint.Out of scope for this PR:
sqlite3_exec(redundant with the existingConnection.runconvenience), and update/commit/rollback hooks (sqlite3_update_hook, etc.) — those need a retained callback box tied toConnection's lifetime, which the current struct doesn't have room for without a larger design change.sqlite3_wal_hookfalls in the same bucket and is likewise deferred.Test plan
swift test— 124 tests pass, including new suitesIncrementalBlobTests,BackupTests, andWALTests, and new cases inConnectionStatementTests/FunctionEdgeCaseTests.