Skip to content

Commit

Permalink
Merge afe2c90 into 6ba2546
Browse files Browse the repository at this point in the history
  • Loading branch information
KoteiIto committed Jan 9, 2018
2 parents 6ba2546 + afe2c90 commit 5b81bfa
Show file tree
Hide file tree
Showing 18 changed files with 80 additions and 3,403 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,5 @@ jspm_packages
.node_repl_history

.DS_Store
index.js
package-lock.json
yarn.lock
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
language: node_js
node_js:
- '9'
- '8'
- '7'
- '6'
Expand Down
3 changes: 3 additions & 0 deletions build/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import * as aws from 'aws-sdk';
import { AthenaClient, AthenaClientConfig } from './lib/client';
export declare function createClient(clientConfig: AthenaClientConfig, awsConfig: aws.Config): AthenaClient;
5 changes: 3 additions & 2 deletions build/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions build/lib/client.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { Athena } from 'aws-sdk';
import { AthenaRequest, AthenaRequestConfig } from './request';
import { AthenaStream, AthenaStreamConfig } from './stream';
export interface AthenaExecutionResult<T> {
records: T[];
queryExecution: Athena.QueryExecution;
}
export interface AthenaExecutionSelect<T> {
toPromise: () => Promise<AthenaExecutionResult<T>>;
toStream: () => AthenaStream<T>;
}
export interface AthenaClientConfig extends AthenaRequestConfig, AthenaStreamConfig {
pollingInterval?: number;
queryTimeout?: number;
concurrentExecMax?: number;
execRightCheckInterval?: number;
}
export declare class AthenaClient {
private config;
private concurrentExecNum;
private request;
constructor(request: AthenaRequest, config: AthenaClientConfig);
execute<T>(query: string): AthenaExecutionSelect<T>;
execute<T>(query: string, callback: (err?: Error, result?: AthenaExecutionResult<T>) => void): void;
private _execute<T>(query, athenaStream, config);
private canStartQuery();
private startQuery();
private endQuery();
}
18 changes: 18 additions & 0 deletions build/lib/request.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/// <reference types="node" />
import { Readable } from 'stream';
export interface AthenaRequestConfig {
bucketUri: string;
baseRetryWait?: number;
retryWaitMax?: number;
retryCountMax?: number;
}
export declare class AthenaRequest {
private athena;
private s3;
constructor(athena: any, s3: any);
startQuery(query: string, config: AthenaRequestConfig): Promise<string>;
checkQuery(queryId: string, config: AthenaRequestConfig): Promise<boolean>;
stopQuery(queryId: string, config: AthenaRequestConfig): Promise<void>;
getQueryExecution(queryId: string, config: AthenaRequestConfig): Promise<any>;
getResultsStream(s3Uri: string): Readable;
}
15 changes: 15 additions & 0 deletions build/lib/stream.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/// <reference types="node" />
import { Duplex } from 'stream';
export interface AthenaStreamConfig {
maxBufferSize?: string;
}
export declare class AthenaStream<T> extends Duplex {
private buffer;
private bufferSize;
private maxBufferSize;
private columns;
private isEnd;
constructor(config: AthenaStreamConfig);
_write(buffer: Buffer, _: string, callback: (err?: Error) => void): Promise<void>;
_read(): Promise<void>;
}
2 changes: 2 additions & 0 deletions build/lib/util.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export declare function sleep(ms: number): Promise<void>;
export declare function getBytes(text: string): number;
Empty file added build/test/client.d.ts
Empty file.
Empty file added build/test/request.d.ts
Empty file.
Empty file added build/test/stream.d.ts
Empty file.
Empty file added build/test/util.d.ts
Empty file.
Loading

0 comments on commit 5b81bfa

Please sign in to comment.