-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathindex.d.ts
More file actions
20 lines (15 loc) · 833 Bytes
/
index.d.ts
File metadata and controls
20 lines (15 loc) · 833 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
export type PuresqlQueryParameters = Record<string, any>;
export type PuresqlAdapter = {
query: <T = any>(query: string) => Promise<T[]>;
escape: (parameter: unknown) => string;
escapeIdentifier: (identifier: unknown) => string;
};
export type PuresqlQuery<T = any> = (parameters: PuresqlQueryParameters, adapter: PuresqlAdapter) => Promise<T>;
export function defineQuery<T = any>(sql: string): PuresqlQuery<T>;
export function loadQueries(filePath): Record<string, PuresqlQuery>;
export const adapters = {
mysql: (connection: any, debugFn: (msg: string) => void) => PuresqlAdapter,
sqlite: (connection: any, debugFn: (msg: string) => void) => PuresqlAdapter,
mssql: (connection: any, debugFn: (msg: string) => void) => PuresqlAdapter,
pg: (connection: any, debugFn: (msg: string) => void) => PuresqlAdapter,
};