mirror of
https://github.com/executeautomation/mcp-database-server.git
synced 2025-12-09 21:12:57 +08:00
Add PostgreSQL support to MCP Database Server
Updated package.json and package-lock.json to include PostgreSQL dependencies. Enhanced README with PostgreSQL usage instructions and configuration details. Modified index.ts to handle PostgreSQL connection parameters and logging. Added PostgresqlAdapter for database interactions.
This commit is contained in:
@@ -53,6 +53,7 @@ export interface DbAdapter {
|
||||
// Import adapters using dynamic imports
|
||||
import { SqliteAdapter } from './sqlite-adapter.js';
|
||||
import { SqlServerAdapter } from './sqlserver-adapter.js';
|
||||
import { PostgresqlAdapter } from './postgresql-adapter.js';
|
||||
|
||||
/**
|
||||
* Factory function to create the appropriate database adapter
|
||||
@@ -68,6 +69,9 @@ export function createDbAdapter(type: string, connectionInfo: any): DbAdapter {
|
||||
}
|
||||
case 'sqlserver':
|
||||
return new SqlServerAdapter(connectionInfo);
|
||||
case 'postgresql':
|
||||
case 'postgres':
|
||||
return new PostgresqlAdapter(connectionInfo);
|
||||
default:
|
||||
throw new Error(`Unsupported database type: ${type}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user