epic-sql
Version:
A Simple But Powerful SQL ORM!!!
18 lines (17 loc) • 1.21 kB
TypeScript
import { Connection } from "./connection";
import { BaseSchema } from "./base-schema";
import { Operator } from "./operator";
export declare type AnythingExcept<T, X> = T extends X ? never : T;
export declare class EpicSQLManager<C extends Connection, S extends Array<typeof BaseSchema>> {
protected Connection: C;
protected Schemas: S;
protected TransactionID: string | null;
constructor(Connection: C, Schemas: S);
getConnection(): C;
query(query: string, params?: Array<any>): Promise<[import("mysql2/typings/mysql/lib/protocol/packets/OkPacket") | import("mysql2/typings/mysql/lib/protocol/packets/ResultSetHeader") | import("mysql2/typings/mysql/lib/protocol/packets/RowDataPacket")[] | import("mysql2/typings/mysql/lib/protocol/packets/RowDataPacket")[][] | import("mysql2/typings/mysql/lib/protocol/packets/OkPacket")[], import("mysql2/typings/mysql/lib/protocol/packets/FieldPacket")[]]>;
sync(disabled?: boolean): Promise<this>;
Transaction<T>(callback: () => Promise<T> | T): Promise<T>;
new(): EpicSQLManager<C, S>;
end(): this;
use<T extends S[number]>(Target: T): <R extends S[number][]>(...Relations: R) => Operator<T, R[number], C, S>;
}