/** * MySQL Adapter * * Database adapter for MySQL databases using the 'mysql2' library. * Implements all methods from BaseAdapter with MySQL-specific optimizations. */ import { BaseAdapter, DatabaseFeature } from './base.adapter'; import { DatabaseType, IsolationLevel } from '../types/enums'; import { IAdapterConnectionOptions, IAdapterConnectionResult } from '../types/connection.interface'; import { IQueryResult, IRawQueryOptions, IRawQueryResult, IBuiltQuery } from '../types/query.interface'; import { IInsertOptions, IInsertResult, IUpdateOptions, IUpdateResult, IDeleteOptions, IDeleteResult, IUpsertOptions, IUpsertResult } from '../types/write.interface'; import { ITransactionContext, ISavepoint } from '../types/transaction.interface'; import { ICountOptions, ISumOptions, IAvgOptions, IMinMaxOptions, IAggregateResult, IGroupByResult, IBuiltAggregation } from '../types/aggregation.interface'; import { ITableDefinition, IAlterTableOperation, ITableSchema, ITableInfo, IIndexDefinition, IIndexInfo, IIndexStatistics, ICreateTableOptions } from '../types/schema.interface'; /** * MySQL database adapter * Provides MySQL-specific implementations for all database operations */ export declare class MySQLAdapter extends BaseAdapter { protected databaseType: DatabaseType; private pool; connect(options: IAdapterConnectionOptions): Promise; testConnection(options: IAdapterConnectionOptions): Promise; disconnect(): Promise; query(query: IBuiltQuery): Promise>; raw(options: IRawQueryOptions): Promise>; insert(options: IInsertOptions): Promise>; update(options: IUpdateOptions): Promise>; delete(options: IDeleteOptions): Promise; upsert(options: IUpsertOptions): Promise>; count(options: ICountOptions): Promise; sum(options: ISumOptions): Promise; avg(options: IAvgOptions): Promise; min(options: IMinMaxOptions): Promise; max(options: IMinMaxOptions): Promise; aggregate(builtAggregation: IBuiltAggregation): Promise; groupBy(builtGroupBy: IBuiltAggregation): Promise[]>; beginTransaction(isolationLevel?: IsolationLevel, readOnly?: boolean, timeout?: number): Promise; commitTransaction(context: ITransactionContext): Promise; rollbackTransaction(context: ITransactionContext): Promise; createSavepoint(context: ITransactionContext, name: string): Promise; releaseSavepoint(context: ITransactionContext, savepoint: ISavepoint): Promise; rollbackToSavepoint(context: ITransactionContext, savepoint: ISavepoint): Promise; supportsSavepoints(): boolean; createTable(definition: ITableDefinition, options?: ICreateTableOptions): Promise; alterTable(tableName: string, operations: IAlterTableOperation[]): Promise; dropTable(tableName: string, ifExists?: boolean, cascade?: boolean): Promise; listTables(): Promise; listTablesWithInfo(): Promise; tableExists(tableName: string): Promise; getTableSchema(tableName: string): Promise; createIndex(index: IIndexDefinition, ifNotExists?: boolean, concurrent?: boolean): Promise; dropIndex(tableName: string, indexName: string, ifExists?: boolean, concurrent?: boolean, cascade?: boolean): Promise; listIndexes(tableName: string, includeSystem?: boolean): Promise; getIndexStatistics(tableName: string, indexName?: string): Promise; escapeIdentifier(identifier: string): string; escapeValue(value: any): string; /** * Check if value is an update operator object * Supports both lowercase (new) and uppercase (legacy) operators */ private isUpdateOperator; getParameterPlaceholder(index: number): string; getColumnTypeString(columnType: string, options?: { minLength?: number; maxLength?: number; precision?: number; scale?: number; enumValues?: string[]; arrayType?: string; }): string; getSupportedFeatures(): DatabaseFeature[]; parseError(error: any): { type: string; message: string; code?: string; details?: Record; }; protected ensureConnected(): void; private buildWhereClause; private buildCountQuery; protected buildColumnDefinition(column: any): string; private buildConstraintDefinition; /** * Detect whether SSL should be enabled based on the connection URL and explicit option. * * Auto-enables for managed cloud MySQL services that enforce SSL: * Azure — *.mysql.database.azure.com * GCP — *.sql.goog (Cloud SQL Private Service Connect) * *.cloudsql.google.com (Cloud SQL with custom DNS) * AWS — *.rds.amazonaws.com (RDS/Aurora) * * Users can also opt in explicitly via ?ssl=true or ?sslmode=require in the URL. */ private detectSsl; private mapIsolationLevel; private formatBytes; }