1 | import { PoolClient } from 'pg';
|
2 | import { ExecutionResult } from 'graphql';
|
3 | import { $$pgClient } from '../postgres/inventory/pgClientFromContext';
|
4 | import { mixed, WithPostGraphileContextOptions } from '../interfaces';
|
5 | interface PostGraphileContext {
|
6 | [$$pgClient]: PoolClient;
|
7 | [key: string]: PoolClient | mixed;
|
8 | }
|
9 | export declare type WithPostGraphileContextFn<TResult = ExecutionResult> = (options: WithPostGraphileContextOptions, callback: (context: PostGraphileContext) => Promise<TResult>) => Promise<TResult>;
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 | declare const withPostGraphileContext: WithPostGraphileContextFn;
|
36 | export default withPostGraphileContext;
|
37 | interface RawExplainResult {
|
38 | query: string;
|
39 | result: any;
|
40 | }
|
41 | declare type ExplainResult = Omit<RawExplainResult, 'result'> & {
|
42 | plan: string;
|
43 | };
|
44 | declare module 'pg' {
|
45 | interface ClientBase {
|
46 | _explainResults: Array<RawExplainResult> | null;
|
47 | startExplain: () => void;
|
48 | stopExplain: () => Promise<Array<ExplainResult>>;
|
49 | }
|
50 | }
|
51 |
|
52 |
|
53 |
|
54 |
|
55 | export declare function debugPgClient(pgClient: PoolClient, allowExplain?: boolean): PoolClient;
|