{"id":18127,"library":"athena-client","title":"athena-client","description":"athena-client is a simple Node.js and TypeScript client for AWS Athena, version 2.5.1. It wraps the AWS SDK to simplify query execution, supporting callbacks, Promises, and streams. Key features include configurable polling intervals, retry logic, concurrent execution limits, encryption options for S3 query results, and workgroup support. It is actively maintained with a stable API, but users must migrate from v1.x due to breaking changes. The package ships TypeScript definitions and is commonly used in Lambda functions.","status":"active","version":"2.5.1","language":"javascript","source_language":"en","source_url":"ssh://git@github.com/KoteiIto/node-athena","tags":["javascript","aws","athena","aws-athena","nodejs","athena-client","lambda","aws-lambda","typescript"],"install":[{"cmd":"npm install athena-client","lang":"bash","label":"npm"},{"cmd":"yarn add athena-client","lang":"bash","label":"yarn"},{"cmd":"pnpm add athena-client","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required dependency for AWS Athena and S3 service interactions.","package":"aws-sdk","optional":false}],"imports":[{"note":"This package does not export a default; use named imports.","wrong":"import athenaClient from 'athena-client';","symbol":"athenaClient","correct":"import { createClient, setConcurrentExecMax } from 'athena-client';"},{"note":"ESM is supported; avoid require() for consistency.","wrong":"const { createClient } = require('athena-client');","symbol":"createClient","correct":"import { createClient } from 'athena-client';"},{"note":"Use this function instead of the deprecated concurrentExecMax config property.","wrong":"","symbol":"concurrentExecMax","correct":"import { setConcurrentExecMax } from 'athena-client';"}],"quickstart":{"code":"import { createClient, setConcurrentExecMax } from 'athena-client';\n\nsetConcurrentExecMax(3);\n\nconst client = createClient(\n  {\n    bucketUri: process.env.BUCKET_URI ?? 's3://my-athena-results',\n    database: 'mydb',\n    pollingInterval: 500,\n    workGroup: 'primary',\n  },\n  {\n    region: process.env.AWS_REGION ?? 'us-east-1',\n    accessKeyId: process.env.AWS_ACCESS_KEY_ID ?? '',\n    secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY ?? '',\n  }\n);\n\nasync function run() {\n  try {\n    const data = await client.execute('SELECT 1').toPromise();\n    console.log(data);\n  } catch (err) {\n    console.error(err);\n  }\n}\n\nrun();","lang":"typescript","description":"Shows how to create a client with configuration, set concurrency limit, and execute a query using Promises."},"warnings":[{"fix":"Replace concurrentExecMax in clientConfig with setConcurrentExecMax(max) call before creating client.","message":"concurrentExecMax property in clientConfig is deprecated; use setConcurrentExecMax() instead.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Migrate from 1.x to 2.x by updating to the new API (e.g., client.execute().toPromise() instead of client.executePromise()).","message":"Version 2.x has breaking changes from 1.x; callback and Promise APIs differ.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Use setConcurrentExecMax() function.","message":"concurrentExecMax clientConfig property is deprecated.","severity":"deprecated","affected_versions":">=2.0.0"},{"fix":"Ensure the S3 bucket exists and has appropriate permissions for Athena.","message":"bucketUri must be a valid S3 URI (e.g., s3://bucket/path/) and the bucket must allow Athena writes.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Adjust pollingInterval in clientConfig to suit query execution time.","message":"Polling interval defaults to 1000ms; for faster queries, set a lower value.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Use named imports: import { createClient } from 'athena-client';","cause":"Incorrect default import syntax when the package exports named exports only.","error":"TypeError: athena_client_1.default is not a function"},{"fix":"Run 'npm install athena-client' and verify package name in import.","cause":"Package not installed or import path misspelled.","error":"Cannot find module 'athena-client'"},{"fix":"Increase queryTimeout or ensure query completes within set time.","cause":"queryTimeout set too low or query takes longer than timeout value.","error":"TimeoutError: Query execution timed out"},{"fix":"Set bucketUri to something like 's3://my-bucket/path/'","cause":"bucketUri missing or malformed.","error":"Error: The bucket URI must be a valid S3 URI starting with 's3://'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}