-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Expand file tree
/
Copy pathsql-proxy.d.ts
More file actions
38 lines (38 loc) · 1.45 KB
/
sql-proxy.d.ts
File metadata and controls
38 lines (38 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
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
36
37
38
import { ExecuteQueryArgs } from "./sql";
export type ClientConfiguration = object;
export type ProxyArgs = {
query: string;
params?: unknown[];
};
export type Row = object;
declare const _default: {
methods: {
/**
* A helper method to get the configuration object that's directly fed to
* the DB client constructor. Used by other features (like SQL proxy) to
* initialize their client in an identical way.
*
* @returns The configuration object for the DB client
*/
getClientConfiguration(): ClientConfiguration;
/**
* Executes a query against the database. This method takes care of
* connecting to the database, executing the query, and closing the
* connection.
*
* @param args - The query string or object to be sent to the DB. SQL query.
* @returns The rows returned by the DB as a result of the query.
*/
executeQuery(args: ExecuteQueryArgs): Row[];
/**
* Adapts the arguments to `executeQuery` so that they can be consumed by
* the SQL proxy (when applicable). Note that this method is not intended to
* be used by the component directly.
*
* @param args - The query string or object to be sent to the DB.
* @returns The adapted query and parameters.
*/
proxyAdapter(args: ExecuteQueryArgs): ProxyArgs;
};
};
export default _default;