mirror of
https://github.com/whyour/qinglong.git
synced 2026-09-21 00:17:47 +08:00
feat(ql3): establish 3.0 incubation baseline
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
export interface PostgresQueryResult<
|
||||
TRow extends Record<string, unknown> = Record<string, unknown>,
|
||||
> {
|
||||
readonly rows: readonly TRow[];
|
||||
readonly rowCount?: number | null;
|
||||
}
|
||||
|
||||
export interface PostgresQueryable {
|
||||
query<TRow extends Record<string, unknown> = Record<string, unknown>>(
|
||||
text: string,
|
||||
values?: readonly unknown[],
|
||||
): Promise<PostgresQueryResult<TRow>>;
|
||||
}
|
||||
|
||||
export interface PostgresClient extends PostgresQueryable {
|
||||
release(): void;
|
||||
}
|
||||
|
||||
export interface PostgresPool extends PostgresQueryable {
|
||||
connect(): Promise<PostgresClient>;
|
||||
}
|
||||
|
||||
export interface PostgresDatabaseResource {
|
||||
readonly pool: PostgresPool;
|
||||
close(): Promise<void>;
|
||||
}
|
||||
|
||||
export type OpenPostgresDatabase = () => Promise<PostgresDatabaseResource>;
|
||||
Reference in New Issue
Block a user