Repository navigation
feat(plugins): #1038 PR A - data layer for sidebar grouping - #1202
Merged
Merged
Conversation
… matviews/foreign tables
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.
Scope
Foundation for issue #1038 (sidebar grouping by object kind). Data layer only — no UI changes. PR B will render against this.
PRD: [/tmp/issue-1038/prd/PRD-sidebar-grouping.md] (local), tracking issue #1038.
Changes
TableInfo.TableType: add.materializedView = "MATERIALIZED VIEW"and.foreignTable = "FOREIGN TABLE". UpdateQuickSwitcherViewModel(only exhaustive switch on TableType) to handle new cases, mapping matviews to view bucket and foreign tables to table bucket as interim until PR B introduces dedicated kinds.PluginDriverAdapter.fetchTables: map"materialized view"/"materialized_view"to.materializedViewand"foreign table"/"foreign_table"to.foreignTable. Existing case-insensitive matching and unknown-type warning logging preserved.PluginProcedureFunctionSupportvia+Routines.swiftextension. ImplementsfetchProcedures/fetchFunctionsviainformation_schema.routinesandfetchProcedureDDL/fetchFunctionDDLviapg_get_functiondef. ExtendsfetchTablesto UNIONpg_matviewsandpg_foreign_tablewith explicit type strings. Capability flags add.materializedViews, .foreignTables, .storedProcedures, .userFunctions.PluginProcedureFunctionSupportvia+Routines.swiftextension. Usesinformation_schema.routinesfiltered byroutine_schema = DATABASE()andSHOW CREATE PROCEDURE/FUNCTIONfor DDL. Capabilities add.storedProcedures, .userFunctions.No ABI bump
currentPluginKitVersionstays at 11. Both changes are additive:PluginCapabilitiesflags already exist in PluginKit (lines 10–13 ofPluginCapabilities.swift); plugins opt in by declaring them.PluginProcedureFunctionSupportis a separate sub-protocol that plugins downcast to. Existing plugins without it continue to work; new methods are not requirements onPluginDatabaseDriver.Capability matrix added in this PR
Other plugins unchanged (PR C will roll out Oracle, MSSQL, DuckDB, ClickHouse, etc.).
Test plan
swiftlint --strictclean on all changed filesxcodebuild buildsucceedsPluginDriverAdapterTableTypeMappingTests(10 tests) cover TABLE/BASE TABLE/PREFIX/VIEW/MATERIALIZED VIEW/materialized_view/FOREIGN TABLE/foreign_table/SYSTEM TABLE variants, case-insensitive matching, unknown-type fallback, and raw-value round tripPluginDriverAdapterTableOpsTestsstill passfetchTablesreturns them with correct types andPluginProcedureFunctionSupportdowncast yields the routines (deferred to PR B integration)