-
Notifications
You must be signed in to change notification settings - Fork 70
/
index.d.ts
55 lines (51 loc) · 1.74 KB
/
index.d.ts
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
declare module 'athena-express' {
import * as aws from 'aws-sdk';
interface ConnectionConfigInterface {
aws: typeof aws;
s3: string;
getStats: boolean;
db: string,
workgroup: string,
formatJson: boolean,
retry: number,
ignoreEmpty: boolean,
encryption: Record<string, string>,
skipResults: boolean,
waitForResults: boolean,
catalog: string,
pagination: string
}
interface QueryResultsInterface<T> {
Items: T[];
DataScannedInMB: number;
QueryCostInUSD: number;
EngineExecutionTimeInMillis: number;
S3Location: string;
QueryExecutionId: string;
NextToken: string;
Count: number;
DataScannedInBytes: number;
TotalExecutionTimeInMillis: number;
QueryQueueTimeInMillis: number;
QueryPlanningTimeInMillis: number;
ServiceProcessingTimeInMillis: number;
}
interface QueryObjectInterface {
sql: string;
db?: string;
pagination?: number;
NextToken?: string;
QueryExecutionId?: string;
catalog?: string;
}
type DirectQueryString = string;
type QueryExecutionId = string;
type OptionalQueryResultsInterface<T> = Partial<QueryResultsInterface<T>> & Pick<QueryResultsInterface<T>, 'QueryExecutionId'>;
type QueryResult<T> = OptionalQueryResultsInterface<T>;
type QueryFunc<T> = (query: QueryObjectInterface|DirectQueryString|QueryExecutionId) => Promise<QueryResult<T>>;
class AthenaExpress<T> {
public new: (config: Partial<ConnectionConfigInterface>) => any;
public query: QueryFunc<T>;
constructor(config: Partial<ConnectionConfigInterface>);
}
}