import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'; import { ApiClient } from '../../api-client'; import type { DbCredentials } from '../../types'; /** SQL文を検証する。writePermissions で INSERT/UPDATE/DELETE の許可を制御 */ export declare function validateSql(sql: string, writePermissions?: { insert: boolean; update: boolean; delete: boolean; }): { valid: boolean; error?: string; }; /** DB接続を作成してクエリを実行する */ export declare function executeQuery(credentials: DbCredentials, sql: string): Promise; /** * Execute a query against `credentials`, transparently routing through an SSH * (plain or SSM) tunnel when `credentials.ssh` is set. * * When tunneled: resolves the SSH credential (`apiClient.getSshCredentials`), * opens a local port forward to the DB host/port (plain SSH or SSM depending on * the credential's `connectionType`), connects mysql2/pg to the forwarded * `127.0.0.1:` endpoint (all other connection fields — * user/password/database/ssl — unchanged), and always closes the tunnel in a * `finally`. When `ssh` is absent, connects directly as before. */ export declare function executeQueryWithTunnel(apiClient: ApiClient, credentials: DbCredentials, sql: string): Promise; /** db_query ツールを MCP サーバーに登録する */ export declare function registerDbQueryTool(server: McpServer, apiClient: ApiClient): void; //# sourceMappingURL=db-query.d.ts.map