refactor(db): modular lib/ architecture and expanded test coverage - #18
Merged
Conversation
Split toolHandlers into focused lib/ modules, deduplicate config loaders, hoist shared driver logic into BaseDriver, and add optional defaultAlias/ defaultSchema plus db_list_tables pagination. Also clean up the toolchain so CI passes: - drop unused DEFAULT_PORTS import and use const in normalizeAlias (eslint) - apply prettier formatting to config.js, configFile.js, toolDescriptors.js - bump vitest & @vitest/coverage-v8 to ^3.2.6 (db + odoo) to clear the critical vitest advisory - add pnpm overrides forcing vite >=6.4.3 and esbuild >=0.28.1 to clear the remaining high advisories 297 tests pass (203 db + 94 odoo), >=88% coverage.
unclecatvn
force-pushed
the
refactor/db-modular-architecture
branch
from
June 16, 2026 09:14
dd04166 to
ec28ba6
Compare
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
@unclecat/mcp-multi-dbinto focusedlib/modules:toolDescriptors,tableListingSql,normalizeAlias,aliasConstants,instructions,logger—toolHandlers.jsshrinks ~480 → ~215 lines.BaseDriver(listTables,healthCheck, error mapping); dialect drivers only implementexecuteQuery+describeTable.defaultAlias(omitdatabaseAliasin tool calls), per-aliasdefaultSchema, anddb_list_tablespagination/filter (limit,offset,namePattern).modeEnforcergates oneffectiveTypesoEXPLAIN ANALYZE <write>cannot bypass readonly mode.lib/+drivers/coverage gate (≥88% lines).Toolchain / CI cleanup
DEFAULT_PORTSimport, useconstinnormalizeAlias.config.js,configFile.js,toolDescriptors.js.vitest&@vitest/coverage-v8to^3.2.6(db + odoo) — clears the critical vitest advisory.vite >=6.4.3andesbuild >=0.28.1— clears the remaining high advisories.pnpm audit --audit-level=highnow passes (0 critical / 0 high).Includes changeset
.changeset/db-refactor-modular.md(minor bump). Pending.changeset/vscode-docs.mdonstaging/masterwill aggregate into the same Version Packages PR.Test plan
pnpm --filter @unclecat/mcp-multi-db test— 203/203 passpnpm --filter @unclecat/mcp-multi-db test:coverage— ≥80% thresholds passpnpm --filter @unclecat/mcp-odoo test— 94/94 passunleashedalias (connection, query orders, list tables)ci-successgreen on PRmaster: verify Version Packages PR picks up both changesets