/** * GoldenDB 数据库适配器 * 使用 mysql2 驱动实现 DbAdapter 接口 * GoldenDB 兼容 MySQL 协议 * * 性能优化:使用批量查询获取 Schema 信息,避免 N+1 查询问题 * 连接管理:使用连接池 + TCP Keep-Alive + 断线自动重试,确保长连接稳定性 */ import type { DbAdapter, QueryResult, SchemaInfo } from '../types/adapter.js'; export declare class GoldenDBAdapter implements DbAdapter { private pool; private config; constructor(config: { host: string; port: number; user?: string; password?: string; database?: string; }); /** * 检测是否为连接断开类错误 */ private isConnectionError; /** * 带断线重试的操作包装器(连接池会自动提供新连接) */ private withRetry; /** * 连接到 GoldenDB 数据库 */ connect(): Promise; /** * 断开数据库连接 */ disconnect(): Promise; /** * 执行 SQL 查询 */ executeQuery(query: string, params?: unknown[]): Promise; /** * 获取数据库结构信息(批量查询优化版本) */ getSchema(): Promise; /** * 获取数据库结构信息的实际实现 */ private _getSchemaImpl; /** * 组装 Schema 信息 */ private assembleSchema; /** * 检查是否为写操作 */ isWriteOperation(query: string): boolean; } //# sourceMappingURL=goldendb.d.ts.map