promoted-athena-query
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

promoted-athena-query

This library is used to simplify calling AWS Athena.

import {AthenaClient} from '@aws-sdk/client-athena';
import {AthenaQuery} from 'promoted-athena-query';

const athenaClient = new AthenaClient({
    region: 'YOUR_AWS_REGION',
    credentials: {
        accessKeyId: 'YOUR_AWS_ACCESS_KEY_ID',
        secretAccessKey: 'YOUR_AWS_SECRET_ACCESS_KEY'
    },
});

export const index = async (): Promise<void> =>
    new AthenaQuery({
        athenaClient,
        query: 'SELECT * FROM my_db.my_table',
        batchProcessor: async (rows) => {
            // Process rows in batches for large queries.
            console.log(rows);
        },
    }).processQuery();

Features

Uses

Scripts

  • Run most commands: npm run finish
  • Build the project: npm run build
    • Validate output bundle size with npm run size
  • Lint the project: npm run lint
  • Run unit tests: npm test or npm test

When developing locally

If you want to test local changes in an actual deployment, use npm link.

  1. Run npm run updateLink.
  2. Go to client directory and run npm link promoted-athena-query.

When you update promoted-athena-query, run npm run updateLink.

When you want to undo, use npm unlink in promoted-athena-query/dist and npm unlink promoted-athena-query in the client directory.

Deploy

We use a GitHub action that runs semantic-release to determine how to update versions. Just do a normal code review and this should work. Depending on the message prefixes (e.g. feat: , fix: , clean: , docs: ), it'll update the version appropriately.

Resources

The base of this repository is a combination of the following repos:

Package Sidebar

Install

npm i promoted-athena-query

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

32 kB

Total Files

9

Last publish

Collaborators

  • prm-deployer