Skip to content

Commit 06debe6

Browse files
tianzhouclaude
andauthored
refactor(connectors): share MySQL/MariaDB schema introspection (#468)
The MySQL and MariaDB connectors carried near-identical copies of every INFORMATION_SCHEMA / SHOW CREATE method (getSchemas, getTables, getViews, tableExists, getTableIndexes, getTableSchema, getTableComment, getStoredProcedures, getStoredProcedureDetail, getDefaultSchema), differing only in the driver's result shape. Fixes landed in one and not the other. Move those into src/connectors/mysql-family-introspection.ts as functions over a row-array query adapter, following the convention already used by mysql-family-health-check.ts. Each connector keeps a small requireQuery() that owns the "not connected" check and unwraps its driver's result shape (mysql2 resolves to [rows, fields]; mariadb to rows). The driver-specific parts (DSN parsing, pooling, timeouts, executeSQL) stay in each index.ts. No behaviour change: the SQL, parameters, error messages and logging are unchanged, and the adapter calls pool.query with the same arity as before. Claude-Session: https://claude.ai/code/session_01T79tgGfqWNqUeTwhRc65MJ Co-authored-by: Claude <noreply@anthropic.com>
1 parent e80f778 commit 06debe6

3 files changed

Lines changed: 474 additions & 829 deletions

File tree

0 commit comments

Comments
 (0)