{"id":13625745,"url":"https://github.com/classmethod/athena-query","last_synced_at":"2026-03-04T05:33:54.485Z","repository":{"id":63988072,"uuid":"572286222","full_name":"classmethod/athena-query","owner":"classmethod","description":"Athena-Query provide simple interface to get athena query results.","archived":false,"fork":false,"pushed_at":"2026-02-20T20:39:28.000Z","size":415,"stargazers_count":11,"open_issues_count":17,"forks_count":6,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-21T01:47:42.034Z","etag":null,"topics":["athena","athena-client","aws","aws-athena","aws-sdk-v3","nodejs"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@classmethod/athena-query","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/classmethod.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-11-30T00:05:59.000Z","updated_at":"2025-11-20T18:06:13.000Z","dependencies_parsed_at":"2025-01-19T09:27:23.730Z","dependency_job_id":"f278cd68-a217-4365-bad7-49e33c9e0677","html_url":"https://github.com/classmethod/athena-query","commit_stats":{"total_commits":78,"total_committers":4,"mean_commits":19.5,"dds":0.3076923076923077,"last_synced_commit":"85e8e46034f1436c2c232b0f0d53458d11766529"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/classmethod/athena-query","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/classmethod%2Fathena-query","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/classmethod%2Fathena-query/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/classmethod%2Fathena-query/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/classmethod%2Fathena-query/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/classmethod","download_url":"https://codeload.github.com/classmethod/athena-query/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/classmethod%2Fathena-query/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30072570,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T05:31:57.858Z","status":"ssl_error","status_checked_at":"2026-03-04T05:31:38.462Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["athena","athena-client","aws","aws-athena","aws-sdk-v3","nodejs"],"created_at":"2024-08-01T21:02:00.908Z","updated_at":"2026-03-04T05:33:54.466Z","avatar_url":"https://github.com/classmethod.png","language":"TypeScript","readme":"# Athena-Query\n\n![Release](https://github.com/classmethod/athena-query/workflows/release/badge.svg)\n![CI](https://github.com/classmethod/athena-query/workflows/CI/badge.svg)\n[![npm version](https://img.shields.io/npm/v/@classmethod/athena-query.svg)](https://www.npmjs.com/@classmethod/athena-query)\n[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/classmethod/athena-query/blob/main/LICENSE)\n\n**Athena-Query** provide simple interface to get athena query results.\n\nAthena-Query was inspired and forked from [athena-express](https://github.com/ghdna/athena-express#readme).\n\n\u003e **Warning**\n\u003e Athena-Query support aws-sdk v3 only. So if you use aws-sdk v2, we recommend to use [athena-express](https://github.com/ghdna/athena-express#readme).\n\n## Installation\n\n```\nnpm install @classmethod/athena-query @aws-sdk/client-athena\n```\n\n```\nyarn add @classmethod/athena-query @aws-sdk/client-athena\n```\n\n## Usage\n\n### Basic Usage\n\nAthena-Query provide `query()` method as [async generator function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function*).\nSo we can use it with `for await () {}`,\n\n```ts\nimport { Athena } from \"@aws-sdk/client-athena\";\nimport AthenaQuery from \"@classmethod/athena-query\";\n\nconst athena = new Athena({});\nconst athenaQuery = new AthenaQuery(athena);\n\nfor await (const item of athenaQuery.query(\"SELECT * FROM waf_logs;\")) {\n  console.log(item); // You can get all items across pagination.\n}\n```\n\nAnd if you break loop out, Athena-Query don't call unnecessary pages of `get-query-result` api.\n\nIf you want to reduce the size of the queried data rather than the retrieved data, you can use the [LIMIT clause](https://docs.aws.amazon.com/athena/latest/ug/select.html#select-parameters).\n\n### Options\n\nWhen you initialize AthenaQuery class, you can pass options to specify the query target.\n\n```ts\nconst athenaQuery = new AthenaQuery(athena, {\n  db: \"test-db\",\n  workgroup: \"test-workgroup\",\n  catalog: \"test-catalog\",\n  outputLocation: \"s3://path/to/query/bucket/\",\n});\n```\n\nWhen you query to Athena, you can pass options for query.\n\n```ts\nconst resultGen = athenaQuery.query(\n  `\n    SELECT * FROM waf_logs\n    WHERE name = ? AND groupId = ? AND score \u003e ?;\n  `,\n  {\n    executionParameters: [\"test\", 123, 456n],\n  },\n);\n```\n","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclassmethod%2Fathena-query","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclassmethod%2Fathena-query","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclassmethod%2Fathena-query/lists"}