Repository navigation
feat(ios): open Cloudflare D1 connections - #3998
Merged
Merged
Conversation
iPhone and iPad open Cloudflare D1 with the macOS plugin compiled into the app. The form takes an Account ID and an API Token and lists the account's databases. PluginBackedDriver no longer owns row writes, so D1 writes through SQLBuilder. iOS sorts engines by connection mode: server, file or API. The D1 plugin, on both apps: - resolves a database by name or UUID with one request - pages the database list - reads BLOBs as bytes - refuses binary parameters - keeps the real connect error - bounds unlimited reads before D1's 50 MB result limit Filters and search switch from LIKE to instr past D1's 50-byte LIKE pattern limit, through a new dialect field. Also fixes on iOS: Truncate on SQLite sent TRUNCATE; a connection switched to a file type kept dialing its SSH tunnel.
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
PluginBackedDriver, as ClickHouse and MongoDB do.PluginBackedDriverno longer owns row writes.PluginRowWritingDrivercarries them for ClickHouse and MongoDB, and D1 writes throughSQLBuilderlike iOS SQLite.DatabaseType.connectionMode(server, file, API), which replaces the file-or-server boolean wherever it meant "has a network transport".DatabaseType.isSQLiteFamilyreplaces.sqlite-only checks that meant SQLite's grammar.SQLDialectDescriptor.likePatternByteLimit: an additive PluginKit field. Kit 41 already includes it, since v0.84.0-beta.2 shipped 40. Past D1's 50-byte LIKE pattern, both apps' filters and the iOS search match withinstr/substr.SQLStatementRowLimit, so the plugin can use it.TRUNCATE TABLE; it now sendsDELETE FROM.DriverFactory.dialsSSHTunnelnow refuses a tunnel for a type with no network transport.localhostas its host.PluginBackedDriverTestsandClickHouseOnIOSTestsnow use the new class.IOSDriverFactoryCatalogTestslists ClickHouse and D1.SQLLimitDetectorTestskeeps one wrapper case; its walk tests moved toSQLStatementRowLimitTests.Test plan
CloudflareD1OnIOSTests,ConnectionFormViewModelCloudflareD1Tests,CloudflareD1DatabaseListTests,SQLBuilderSQLiteFamilyTests,SQLStatementRowLimitTests,SQLSubstringMatchTests,FilterSQLGeneratorLikeLimitTests,DatabaseTypeSQLiteFamilyTests, plus D1 cases in the refusal, catalog, parity, routing, form-edit, formatter, info and import tests.ConnectionManagerTestscovers a tunnel the factory declines.swift teston TableProCore (all targets green), the macOS Unit suites for the changed types, the macOS build,AllPlugins, and the iOS app and test bundle compiled for the simulator. This Mac has no simulator runtime, so the iOS suites run on CI./rawBLOB shape.apple/scripts/probes/check-cloudflare-d1-wire-shapes.shprints it.