1 | import { Knex } from 'knex';
|
2 | import { QueryClientContract, TransactionClientContract } from '@ioc:Adonis/Lucid/Database';
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 | export declare class QueryRunner {
|
10 | private client;
|
11 | private debug;
|
12 | private logData;
|
13 | private reporter;
|
14 | constructor(client: QueryClientContract | TransactionClientContract, debug: boolean, logData: any);
|
15 | /**
|
16 | * Is query dialect using sqlite database or not
|
17 | */
|
18 | private isUsingSqlite;
|
19 | /**
|
20 | * Find if query has a transaction attached to it, by using
|
21 | * `useTransaction` method
|
22 | */
|
23 | private isInTransaction;
|
24 | /**
|
25 | * Find if query is a write query or not.
|
26 | */
|
27 | private isWriteQuery;
|
28 | /**
|
29 | * Returns read or write client by inspecting the query
|
30 | */
|
31 | private getQueryClient;
|
32 | /**
|
33 | * Executes the query by handling exceptions and returns it back
|
34 | * gracefully.
|
35 | */
|
36 | private executeQuery;
|
37 | /**
|
38 | * Executes the knex builder directly
|
39 | */
|
40 | private executeDirectly;
|
41 | /**
|
42 | * Executes query by using a proper read or write connection.
|
43 | */
|
44 | private executeUsingManagedConnection;
|
45 | /**
|
46 | * Run query by managing its life-cycle
|
47 | */
|
48 | run(query: Knex.QueryBuilder | Knex.Raw): Promise<any>;
|
49 | }
|