Skip to content

refactor(macos): make every driver catalog read name its caller's schema - #4372

Merged
datlechin merged 1 commit into
mainfrom
refactor/macos-driver-layer-audit
Nov 20, 2026
Merged

datlechin merged 1 commit into
mainfrom
refactor/macos-driver-layer-audit

Conversation

@datlechin

Copy link
Copy Markdown
Member

Summary

  • DL-10: DatabaseDriver drops its schema-less catalog reads (fetchTables(), fetchColumns(table:), indexes, foreign keys, check constraints, triggers, row counts, DDL, table metadata, fetchAllForeignKeys(), the unused fetchAllDependentTypes/Sequences(forTables:)). The adapter answered each with the driver's own currentSchema.
  • Reads that had no schema form now take one: fetchAllColumns, sampleFieldPaths, trigger template, definition and drop, both fetchExactRowCount, dependent types and sequences, fetchViewDefinition, fetchObjectComment, fetchTableOptions, fetchForeignKeys(forTables:), fetchIndexes(forTables:).
  • PluginDriverAdapter resolves a nil schema in one place, readSchema(_:), instead of a schema ?? currentSchema in each forward.
  • Every caller passes its own scope's schema: AI chat context, Join Builder, ER diagram, row counts and pagination, DDL export, object comments, triggers, MCP schema tools, autocomplete registry, schema loads, import, table transfer, export tree, structure tab, Edit View.
  • SchemaService reads routines, triggers, types and server objects in the same schema as the table list it loads.
  • The 29 hand-written DatabaseDriver test doubles implement the schema forms only.
  • Tests changed on purpose: SchemaRefreshCommitCostTests.schemaSwitchReadsTheBrowsedSchemaAlone and discardReadsNothing now see the browse read name its schema (tables:s5).

Test plan

  • PluginDriverAdapterSchemaForwardingTests: each read reaches the plugin with the caller's schema; nil reads the session's.
  • Suites of the changed callers: SchemaService*, SchemaRefresh*, SQLSchemaProvider*, ERDiagram*, ExportService*, ExactRowCounter*, TriggerInfoMapping*, TableStructureLoader*, PluginDriverAdapter*.
  • verify.sh build, test, lint.

Refs #4272

@datlechin
datlechin merged commit 743be38 into main Nov 20, 2026
9 of 11 checks passed
@datlechin
datlechin deleted the refactor/macos-driver-layer-audit branch November 20, 2026 14: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