# athena-aws-v3

> This package is made to execute athena queries in AWS SDK for Javascript V3

Latest version **1.1.1** (published 2023-08-21) · ISC license · 0 weekly downloads

## Install

```sh
npm install athena-aws-v3
pnpm add athena-aws-v3
yarn add athena-aws-v3
bun add athena-aws-v3
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2023-08-21 |
| First published | 2023-05-19 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Hasan Fayyad |
| Maintainers | hasan-123 |
| Keywords | athena, aws, query, S3, CSV |

## Links

- npm: https://www.npmjs.com/package/athena-aws-v3
- Repository: https://github.com/HASANF-12/athena-aws-v3
- Homepage: https://github.com/HASANF-12/athena-aws-v3#readme
- Issues: https://github.com/HASANF-12/athena-aws-v3/issues
- npm.io page: https://npm.io/package/athena-aws-v3

## Dependencies (5)

- [csvtojson](https://npm.io/package/csvtojson.md) ^2.0.10
- [stream-to-promise](https://npm.io/package/stream-to-promise.md) ^3.0.0
- [@aws-sdk/client-s3](https://npm.io/package/@aws-sdk/client-s3.md) ^3.347.1
- [@aws-sdk/client-athena](https://npm.io/package/@aws-sdk/client-athena.md) ^3.333.0
- [@aws-sdk/s3-request-presigner](https://npm.io/package/@aws-sdk/s3-request-presigner.md) ^3.395.0

## Alternatives

- [gamedig](https://npm.io/package/gamedig.md) — 29.3K weekly downloads
- [join-monster](https://npm.io/package/join-monster.md) — 12.8K weekly downloads
- [masked](https://npm.io/package/masked.md) — 5.5K weekly downloads
- [@comunica/actor-query-process-explain-logical](https://npm.io/package/@comunica/actor-query-process-explain-logical.md) — 4.7K weekly downloads
- [@veracity/vui](https://npm.io/package/@veracity/vui.md) — 4.6K weekly downloads

## Recent versions

- 1.1.1 (latest) — 2023-08-21
- 1.1.0 — 2023-08-08
- 1.0.5 — 2023-07-05
- 1.0.4 — 2023-07-05
- 1.0.3 — 2023-06-07
- 1.0.2 — 2023-06-07
- 1.0.1 — 2023-05-19
- 1.0.0 — 2023-05-19

## README

# athena-aws-v3

athena-aws-v3 is a simple Node.js package that allows you to execute Athena queries on AWS. It uses the AWS SDK for JavaScript (v3) to manage the execution of your queries and fetch the results directly from S3 CSV files without waiting much time.

## Features

-   Async/Await for managing query execution
-   Handles AWS Athena queries
-   Allows you to set your output location on S3
-   Fetches all rows of the result set

## Installation

Use the package manager [npm](https://npmjs.com/) to install athena-aws-v3.

`npm install athena-aws-v3` 

## Usage

You can use this package in your JavaScript code like this:

    const athenaService = require('athena-aws-v3');
    
    const config = {
      region: 'your-aws-region', // e.g. 'us-west-2'
      // Add other necessary AWS SDK configuration
    };
    
    const athena = new athenaService(config);
    
    const query = 'SELECT * FROM mytable';
    const s3Location = 's3://my-bucket/my-folder';
    const databaseName = 'mydatabase';
    const workGroup = 'myWorkGroup';
    
    const result = await athena.executeAthenaQuery(query, s3Location, databaseName, workGroup);

Please ensure that you replace 'your-aws-region', 'SELECT * FROM mytable', 's3://my-bucket/my-folder', and 'mydatabase' with your actual AWS region, Athena query, S3 location for query results, and Athena database name respectively.

## Error Handling

In case the Athena query execution fails, the `executeAthenaQuery` function throws an error with a message specifying the query status returned from AWS Athena.

## Configuration

The constructor of the `athena-aws-v3` class accepts an AWS SDK configuration object. This configuration is passed directly to the underlying `Athena` client from `@aws-sdk/client-athena`. For more details on the options available, check out the AWS SDK for JavaScript [documentation](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-athena/index.html).

## Limitations

-   The package currently only supports querying databases in Athena, with the results written to a specified S3 location.
-   It assumes that you have the necessary AWS credentials available in your environment or through your configuration.

---
_Source: https://npm.io/package/athena-aws-v3 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
