feat(plugins): offer Turso as its own engine and hold the count in docs - #2561
Merged
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.
The guard existed and had disabled itself
docs/scripts/check-docs-against-source.pyalready counted database types out ofPluginMetadataRegistry*.swiftand compared them against the docs. It never caught this drift fortwo reasons:
"Twenty-seven"is accepted unconditionally, so the docs could say twenty-seven forever. And thesearch ran over
databases/index.mdxalone, which was the one page already correct. The three wrongnumbers all sat on pages the check never opened.
That is the root cause. The numbers are the symptom. The site said 25, the docs said 27, the app
offered 28, and nothing in either repo could tell.
Turso was the reason the answer was not 28
reverseTypeIndexholds six aliases. Five of them (MariaDB, Redshift, CockroachDB, PGlite,ScyllaDB) carry a curated entry of their own alongside the alias. Turso was the only one that did
not, and that gap was user-visible in two ways:
installing it needs a connection of that type.
PluginMetadataRegistry+KafkaDefaults.swiftalready documents this exact trap for registry-only drivers.
registerVariantfound no curated entry and registered the libSQL plugin'ssnapshot under
Turso, so the picker showed a Turso row wearing libSQL's icon and libSQL'stagline, "Distributed SQLite by Turso", directly under the libSQL row saying the same thing.
ScyllaDB is the precedent and it holds in both repos: an alias of Cassandra with a curated entry
all the same, and on the site a separate tile sharing the
cassandradriver group.PluginMetadataRegistry+TursoDefaults.swiftgives Turso the same treatment, so 29 falls out ofthe count rather than being asserted on top of it.
Turso keeps libSQL's connection fields exactly, local-file mode included. The driver reads
libsqlModeand treats anything butlocalas remote, so a remote-only list would still connect,but
ConnectionStorageandConnectionExportServicederive Keychain migration and exportredaction from that list and Turso connections saved in local mode already exist in the field.
reverseTypeIndex["Turso"] = "libSQL"is untouched, so driver lookup is unchanged.29 is the number of keys in
allRegisteredTypeIds(), measured under XCTest rather than counted bygrep. 23 driver plugin targets serve those 29, because one plugin can serve several types.
Three places this went further than the brief, and why
The test counts the built-in defaults, not
allRegisteredTypeIds(). Both answer 29. Theregistry is a process-global singleton,
SwitchDatabaseReconnectFailureTestsregisters a synthetictype and withdraws it, and Swift Testing runs suites in parallel, so exact equality on the runtime
accessor is flaky by construction. A separate case asserts the runtime accessor is a superset,
which is stable and still catches a type that stops being offered.
Two of the three counts on
index.mdxare deleted rather than corrected. STYLE.md 9: a numberin the source is owned by exactly one page. "Using all 27 engines" becomes "Every engine", and the
paragraph sitting directly under
<DriverCounts />no longer restates the snippet above it. Onlythe frontmatter
descriptionkeeps a number, because Mintlify prints it as page metadata where nosnippet can reach, and the new check verifies its arithmetic instead.
The snippet's defect was mixed units, not a wrong number. "Five drivers ship inside the app and
cover nine databases. Another 18 come from the registry" is nine engines plus eighteen plugins,
and a reader adds them to 27. The eighteen registry plugins cover twenty engines.
What the new check covers
engine countsscans everydocs/**/*.mdxfor a count of engines, and adds two checks for thenumbers a regex over prose cannot reach: the snippet's two halves have to add up to the registry
total, and the
index.mdxfrontmatter's named engines plus itsand N morehave to as well.changelog.mdxis exempt; its entries state what a past release shipped.Verification
name, including the missing
Tursotable row. Restored, green.verify.sh docsPASS, both scripts.PluginMetadataRegistryTypeCountTests(5 cases) plusDatabaseTreeCapabilityTests,PluginManagerVariantAccessorTests,DatabaseTypeTests,LibSQLConnectionFieldsTests,PluginMetadataRegistryBrandingTests,PluginMetadataRegistrySystemDatabaseTests,PluginMetadataSwitchRoutingTests,DriverPluginMetadataTests,PluginMetadataRegistryVariantTests,PluginMetadataRegistryDownloadableTestsall green.swiftlint lint --stricton all three Swift files, 0 violations..swiftlint.ymlonly includesTablePro, so the test path was passed explicitly.TableProTests,TableProUITests,docs/scripts,.githubandscriptsfor any otherassertion pinning an old engine count. The
"Twenty-seven"escape hatch was the only one.Turso lands in
PluginMetadataRegistry+TursoDefaults.swiftrather than in+RegistryDefaults.swiftbecause that file is at 1208 lines against a 1200-line SwiftLint warning, and
+SurrealDBDefaults,+KafkaDefaultsand+ElasticsearchDefaultsare the existing one-type-per-file precedent.There is no
turso-iconasset, so Turso reuseslibsql-icon. Its tagline, name and URL scheme areits own.
CHANGELOG
One entry under Added. This started as a docs-only change, where CLAUDE.md waives the entry, but
adding the Turso snapshot changes what the New Connection picker shows.
https://claude.ai/code/session_018HCNaxeFcFdzueFh6x33xj