fix(plugins)!: SQL Server tables on connect, cell-edit datetime, chip parity; PluginKit ABI 10→11#1183
Merged
Merged
Conversation
… parity; PluginKit ABI 10→11
…dd test coverage; oracle switchDatabase override
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
User reports two SQL Server bugs after a fresh install:
dboschema, even when the connection form'sDatabaseis set.Conversion failed when converting date and/or time from character string.Five interlocking root causes:
TabRouter.openConnectionopens the window beforeensureConnected, so the window's firstloadSchemaIfNeededruns against anildriver and returns silently. The retry hook ondatabaseDidConnectonly re-ransetupPluginDriver, neverloadSchemaIfNeeded. The listener now runs both, then tears itself down.connect()runsSELECT SCHEMA_NAME()afterdbuse(...)and seeds_currentSchemafrom the server'sdefault_schema_name. The connection form'sSchemafield still acts as an explicit override.databaseNamefield intocurrentDatabase+currentSchema+databaseGroupingStrategywith a computedchipText. SQL Server / PostgreSQL / Oracle / BigQuery (.bySchemaengines) show the active schema; MySQL / SQLite (.byDatabase) show the database. Tooltips dispatch on grouping.switchDatabasemis-routing removed:DatabaseManager.switchDatabasehad a branch that, for any driver withsupportsSchemaSwitching: true, routedswitchDatabase(database)throughschemaDriver.switchSchema(database). That treated the database name as a schema name and poisonedlastSchemain UserDefaults. Branch removed;switchDatabasealways calls the driver's realswitchDatabase..bySchemaengines resetcurrentSchematodefaultSchemaNameafter the switch. Oracle gets a one-lineswitchDatabaseoverride aliasing toswitchSchemato preserve its existing behavior.PluginDatabaseDriver.generateStatementsgainsprimaryKeyColumns: [String]. All 21 pluginInfo.plistfiles bumped, appcurrentPluginKitVersionbumped, all driver overrides updated.TOP (1)guard since WHERE is now unique). Falls back to all-columns +TOP (1)when no PK.MSSQLDatetimeFormatterreformats DATETIME / DATETIME2 / SMALLDATETIME values from FreeTDS's msdblibMMM d yyyy h:mm:ss:fffffffAMoutput to ISO 8601 (yyyy-MM-dd HH:mm:ss[.fffffff]). AScanner-based parser preserves all fractional digits withoutFoundation.Dateprecision loss. Validates AM/PM hours to (1...12), 24-hour to (0...23), year to (1...9999), passes through already-ISO inputs verbatim. SYBMSDATETIMEOFFSET (43) is intentionally excluded until the offset suffix format is verified end-to-end.Breaking change (
!in title)TableProPluginKitVersionadvances 10→11 becausegenerateStatementsgained a parameter. All separately-distributed plugins must ship a fresh build with the bumped Info.plist. The user-installed plugin loader rejects mismatched versions to avoid the documentedEXC_BAD_INSTRUCTIONcrash on protocol-witness dispatch.After merge:
v<next>ships Layers 1, 3, 4, and the app-side parts of 5Aplugin-mssql-v<next>ships Layers 2, 5A signature, 5B, 5Cplugin-oracle-v<next>ships the newswitchDatabaseoverride + ABI bumpplugin-<name>-v<next>tag carrying the signature update + Info.plist bumpFiles
MainContentCoordinator.swift,DatabaseManager+Sessions.swift,ConnectionToolbarState.swift,ConnectionStatusView.swift,TableProToolbarView.swift,MainContentCoordinator+Navigation.swift,MainContentView+Helpers.swift,QueryExecutionCoordinator+Helpers.swift,SessionStateFactory.swift,DataChangeManager.swift,PluginDriverAdapter.swift,PluginManager.swiftPlugins/TableProPluginKit/PluginDatabaseDriver.swiftPlugins/MSSQLDriverPlugin/MSSQLPlugin.swiftPlugins/OracleDriverPlugin/OraclePlugin.swiftInfo.plistfiles:TableProPluginKitVersion: 10 → 11TableProTests/Models/ConnectionToolbarStateTests.swift(chip text per grouping strategy),TableProTests/Plugins/MSSQLDatetimeFormatterTests.swift(parser, including AM/PM 12-hour boundaries and ISO passthrough),TableProTests/Plugins/MSSQLPluginDriverDMLTests.swift(PK-aware UPDATE/DELETE generation, composite keys, NULL PK, identifier escaping)CHANGELOG.md: four user-facing entries under Unreleased > FixedTest plan
xcodebuild -project TablePro.xcodeproj -scheme TablePro -configuration Debug build -skipPackagePluginValidationxcodebuild ... test -only-testing:TableProTests/ConnectionToolbarStateTestsxcodebuild ... test -only-testing:TableProTests/MSSQLDatetimeFormatterxcodebuild ... test -only-testing:TableProTests/MSSQLPluginDriverDMLSA / TableProRepro!2026, seededSalesandNorthwind): delete the existing test connection in Welcome, re-create withDatabase = Sales, connect → expectInvoicesandRegionsimmediately, chip showsdboOrders.CustomerId, Cmd+S → expect save success, preview SQL isUPDATE [Orders] SET [CustomerId] = ? WHERE [Id] = ?Orders.PlacedAtto a new datetime, Cmd+S → expect save success, no "Conversion failed" errorpublicOut of scope
Schemafield for MSSQL (kept as user override per design choice)TabRouter.openConnectionto await connect before opening the window; the listener-based fix is the Apple-correct pattern