@aradox/multi-orm
Version:
Type-safe ORM with multi-datasource support, row-level security, and Prisma-like API for PostgreSQL, SQL Server, and HTTP APIs
41 lines • 1.65 kB
TypeScript
import { Adapter, AdapterCapabilities, FindManyAdapterArgs, FindUniqueAdapterArgs, CreateAdapterArgs, UpdateAdapterArgs, DeleteAdapterArgs, CountAdapterArgs, TransactionOptions, Transaction } from '../types/adapter';
import { Model } from '../types/ir';
export interface MySQLPoolConfig {
host: string;
port?: number;
user: string;
password: string;
database: string;
connectionLimit?: number;
waitForConnections?: boolean;
queueLimit?: number;
connectTimeout?: number;
}
export declare class MySQLAdapter implements Adapter {
private pool;
private modelMeta;
capabilities: AdapterCapabilities;
/**
* Set model metadata for table name mapping
*/
setModelMetadata(models: Record<string, Model>): void;
constructor(connectionString: string | MySQLPoolConfig);
private toSnakeCase;
private toColumnName;
findMany(model: string, args: FindManyAdapterArgs): Promise<any[]>;
findUnique(model: string, args: FindUniqueAdapterArgs): Promise<any | null>;
create(model: string, args: CreateAdapterArgs): Promise<any>;
update(model: string, args: UpdateAdapterArgs): Promise<any>;
delete(model: string, args: DeleteAdapterArgs): Promise<any>;
count(model: string, args: CountAdapterArgs): Promise<number>;
private buildSelectQuery;
private buildWhereClause;
private buildOperatorCondition;
private buildInsertQuery;
private buildUpdateQuery;
private buildDeleteQuery;
private buildCountQuery;
beginTransaction(options?: TransactionOptions): Promise<Transaction>;
close(): Promise<void>;
}
//# sourceMappingURL=mysql.d.ts.map