Skip to content

feat(sidebar): wire routines end-to-end (#1038 PR C) - #1204

Merged
datlechin merged 5 commits into
mainfrom
feat/1038-routines-wireup
May 11, 2026
Merged

datlechin merged 5 commits into
mainfrom
feat/1038-routines-wireup

Conversation

@datlechin

Copy link
Copy Markdown
Member

Summary

Wires the routines pipeline added in PRs A and B end-to-end. After this PR, opening a Postgres or MySQL connection automatically shows actual procedures and functions in the sidebar with their own Refresh actions; other engines surface an empty (hidden) routine section until they adopt PluginProcedureFunctionSupport.

  • PluginDriverAdapter downcasts to PluginProcedureFunctionSupport and maps PluginRoutineInfo to the app's RoutineInfo. Drivers without the protocol return an empty list, so unsupported engines no-op safely.
  • DatabaseDriver gains fetchProcedures(schema:) and fetchFunctions(schema:) with default [] implementations, keeping every existing driver source compiling untouched.
  • SchemaService caches procedures and functions per connection. load() fetches them in parallel with tables via async let; routine errors are logged and leave the slot empty without blocking the table load or flipping the state to .failed.
  • SidebarView reads routines from the same SchemaService it already uses for tables. The section header "Refresh" action dispatches to the matching coordinator method per kind.

Scope is wire-up only: no plugin changes, no PluginKit ABI version bump, no TableInfo.TableType changes.

Test plan

  • xcodebuild ... test -only-testing:TableProTests/SchemaServiceRoutinesTests (5 tests pass): caches procedures and functions on load, concatenates routines in routines(for:), routine fetch failures do not block table loading, invalidate() clears all caches, reloadProcedures() refreshes only procedures.
  • xcodebuild ... test -only-testing:TableProTests/SidebarViewModelMultiSectionTests still passes (existing filteredRoutines coverage from PR B).
  • swiftlint --strict clean on every touched source file.
  • Full build succeeds.
  • Manual: connect to Postgres, confirm Procedures and Functions sections render with item counts and survive search filtering, right-click the section headers and confirm Refresh updates each kind in isolation.
  • Manual: connect to MySQL, same checks.
  • Manual: connect to SQLite/Redis, confirm the routine sections stay hidden (capability gate plus empty list).

@datlechin
datlechin merged commit a7dd07a into main May 11, 2026
2 checks passed
@datlechin
datlechin deleted the feat/1038-routines-wireup branch May 11, 2026 04:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant