fix(plugins): version-gate SQL across Cassandra, MongoDB, ClickHouse, MSSQL, MySQL#1242
Merged
Conversation
Signed-off-by: Ngô Quốc Đạt <datlechin@gmail.com>
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
Mirrors PR #1241 (PostgreSQL) for the other driver plugins. Each affected plugin gets a small
*Capabilitiesstruct keyed off the connection's reported server version, with version-gated SQL routed through it. Same shape across plugins — greppable, documents minimum supported version inline.Changes
CassandraPlugin.swift:connect()system_schemakeyspace). Six downstreamsystem_schema.*queries previously crashed with cryptic "table not found" during sidebar load.MongoDBConnection.swift:listDatabasesSyncnameOnly: trueflag for servers <3.4 which don't accept it.ClickHousePlugin.swift:fetchIndexessystem.data_skipping_indicesquery on <19.17.MSSQLPlugin.swift:createViewTemplate+editViewFallbackTemplateCREATE OR ALTER VIEWonly on SQL Server 2016+ (major ≥13). Older versions getIF EXISTS DROP / CREATE VIEW.MySQLPlugin.swift:explainVariantsEXPLAINvariant alongsideEXPLAIN FORMAT=JSON(5.6.5+). User can pick.Why these and not others
The full audit (6 parallel agents) flagged 14 candidate sites across 14 plugins. Five of those were false positives or not worth gating:
COLLATION_CHARACTER_SET_APPLICABILITY— auditor was wrong; this view has been in MySQL since 5.0.information_schema/duckdb_indexes— only affects DuckDB <0.9. Effectively no users in 2026.ALTER TABLE … RENAME/DROP COLUMN— TablePro bundles its own libsqlite viascripts/download-libs.sh. Bundled version is modern.authVerifierUnsupportedfor password-format-on-account, vsauthVersionNotSupportedfor server-version) are correctly distinguishing two different error categories. Easy to misread but technically correct.pragma_*()table-valued functions present (3.16+).Architecture
Each plugin gets a sibling file:
Same shape as
PostgreSQLCapabilitiesfrom PR #1241. Each flag documents its minimum version inline next to the comparison.Test plan
listDatabasessucceeds (was failing onnameOnlyflag).CREATE OR ALTER.IF EXISTS DROP / CREATE.EXPLAINandEXPLAIN (JSON)).Notes
Bundled plugins ship with the next app release. No registry republish per
feedback_no_registry_for_builtins. Cassandra/MongoDB/MSSQL are registry plugins — they'll need the standard re-tag + plugins.json bump after merge.