Repository navigation
refactor(ios): run SQLite on the Mac plugin's driver - #4405
Merged
Merged
Conversation
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
SQLitePluginDriverbehindPluginBackedDriver(SQLiteBackedDriver), compiled as a source path like DuckDB, D1, ClickHouse and MongoDB. The hand-writtenSQLiteDriver.swiftandSQLiteTransferEngine.swiftare gone; exports ask the plugin throughPluginTransferCatalog, imports write throughPluginWriteDialect.TableProSQLiteCoreimportSQLite3under#if os(iOS)andCSQLiteon macOS, whose dependency becomes macOS-only. SwiftLint'svendored_sqlite_importallows exactly that import. Extension loading and the SSH agent backend stay on the Mac.SQLiteBackedDriverkeeps the iOS file handling: app, picked and in-memory files, no create for an existing file, read-only readers, a WAL reader orVACUUM INTOsnapshot for a transfer, leftover snapshots swept at launch, access ended after SQLite closed the file, a 5 s lock wait unless the connection sets a timeout, the rowid alias shown as auto-increment, a typeless all-blob column typed BLOB.SQLiteLocalBackendtakes open flags; a failed open closes its handle.readValues), so long text is copied up to its preview and a BLOB only counted. iOS cuts withPluginGridCut, now shared with DuckDB.pulledRows), so the grid's statements run in between, as before on iOS.query_onlyis restored.PluginBackedDriver) leaves the window's database to compare, so an import whose session moved is still refused.executespells a BLOB in hex, columns list generated columns, defaults read as the Mac shows them.SQLiteDriverFileTests(SQLiteInterruptHandleTests, which pinned the native interrupt handle, replaced by Stop, cap, cut and refusal cases inSQLiteBackedDriverTests),SQLiteTransferEngineTests,ExportTwinNameTests,IOSDriverFactoryLocalFileTests,DuckDBGridDecodeTests(rename), and the callers that builtSQLiteDriver.SQLiteLocalBackendTests(binding, comment-only text, open flags, value reads, pulled reads, Stop beside an open read).Refs #4272 (IO-09, second of seven engines).
Test plan
SQLiteBindingTestsfails on main: an empty blob reads back as NULL, a short value list writes NULL.verify.sh ioswith the SQLite, transfer, import, factory and DuckDB suites.verify.sh test SQLiteDriverTestsandverify.sh plugins.