Query 3 different databases in one session
Wann einsetzen: Your stack has Postgres for primary data, MySQL for a legacy service, and SQL Server for a reporting copy — and you want one AI assistant across all.
Voraussetzungen
- DSN for each DB with read-only creds — postgres://, mysql://, sqlserver://, sqlite://, oracle:// formats
Ablauf
-
Configure multiple DSNsShow me which DB I'm currently pointed at. If needed, switch to the MySQL DSN.✓ Kopiert→ Clear active-DB indicator
-
Inspect schemaList tables in the current DB with approximate row counts.✓ Kopiert→ Table catalog
-
Cross-reference across DBsQuery Postgres for user emails, then query MySQL legacy_users for the same emails, tell me who's in one but not the other.✓ Kopiert→ Reconciliation report
Ergebnis: A single workflow across heterogeneous DBs without juggling different MCP servers.
Fallstricke
- SQL dialect differences trip Claude (e.g. LIMIT vs TOP) — Tell Claude explicitly which DB flavor the current query targets, or split into DB-specific turns