{"id":28452780,"url":"https://github.com/trinodb/trino-js-client","last_synced_at":"2025-06-27T23:31:15.487Z","repository":{"id":41448158,"uuid":"506902188","full_name":"trinodb/trino-js-client","owner":"trinodb","description":"TypeScript client library for Trino","archived":false,"fork":false,"pushed_at":"2025-06-02T23:00:22.000Z","size":49093,"stargazers_count":38,"open_issues_count":12,"forks_count":19,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-06-05T04:15:02.463Z","etag":null,"topics":["client","javascript","library","trino","trinodb","typescript"],"latest_commit_sha":null,"homepage":"http://trinodb.github.io/trino-js-client/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/trinodb.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}},"created_at":"2022-06-24T06:28:41.000Z","updated_at":"2025-04-29T06:11:49.000Z","dependencies_parsed_at":"2023-09-28T04:02:51.575Z","dependency_job_id":"95f78b83-b3b7-4712-8ec9-0033038b02fa","html_url":"https://github.com/trinodb/trino-js-client","commit_stats":{"total_commits":498,"total_committers":7,"mean_commits":71.14285714285714,"dds":"0.21887550200803207","last_synced_commit":"a55d13ab2c1ce62b2a2477835c52112529a2f179"},"previous_names":["trinodb/trino-js-client","regadas/trino-js-client"],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/trinodb/trino-js-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trinodb%2Ftrino-js-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trinodb%2Ftrino-js-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trinodb%2Ftrino-js-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trinodb%2Ftrino-js-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trinodb","download_url":"https://codeload.github.com/trinodb/trino-js-client/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trinodb%2Ftrino-js-client/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259720870,"owners_count":22901433,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["client","javascript","library","trino","trinodb","typescript"],"created_at":"2025-06-06T18:12:51.001Z","updated_at":"2025-06-27T23:31:15.480Z","avatar_url":"https://github.com/trinodb.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# trino-js-client\n\nA [Trino](https://trino.io) client for [Node.js](https://nodejs.org/).\n\nJoin us on [Trino Slack](https://trino.io/slack) in\n[#core-dev](https://trinodb.slack.com/archives/C07ABNN828M) to discuss and help\nthis project.\n\n[![@latest](https://img.shields.io/npm/v/trino-client.svg)](https://www.npmjs.com/package/trino-client)\n![it-tests](https://github.com/trinodb/trino-js-client/actions/workflows/it-tests.yml/badge.svg)\n![license](https://img.shields.io/github/license/trinodb/trino-js-client)\n\n## Features\n\n- Connections over HTTP or HTTPS\n- Supports HTTP Basic Authentication\n- Per-query user information for access control\n\n## Requirements\n\n- Node 12 or newer.\n- Trino 0.16x or newer.\n\n## Install\n\n`npm install trino-client` or `yarn add trino-client`\n\n## Usage\n\nFor additional info on all available methods and types [have a look at the\n`API` documentation](https://trinodb.github.io/trino-js-client/).\n\n### Create a Trino client\n\n```typescript\nconst trino: Trino = Trino.create({\n  server: 'http://localhost:8080',\n  catalog: 'tpcds',\n  schema: 'sf100000',\n  auth: new BasicAuth('test'),\n});\n```\n\n### Submit a query\n\n```typescript\nconst iter: Iterator\u003cQueryResult\u003e = await trino.query(\n  'select * from customer limit 100'\n);\n```\n\n### Iterate through the query results\n\n```typescript\nfor await (const queryResult of iter) {\n  console.log(queryResult.data);\n}\n```\n\n### Alternative: map and aggregate the data\n\n```typescript\nconst data: QueryData[] = await iter\n  .map(r =\u003e r.data ?? [])\n  .fold\u003cQueryData[]\u003e([], (row, acc) =\u003e [...acc, ...row]);\n```\n\n## Examples\n\nMore usage examples can be found in the\n[integration tests](https://github.com/trinodb/trino-js-client/blob/main/tests/it/client.spec.ts).\n\n## Build\n\nUse the following commands to build the project locally with your modifications,\nand in preparation to contribute a pull request.\n\nRequirements:\n\n* yarn\n\nInstall dependencies:\n\n```shell\nyarn install --frozen-lockfile\n```\n\nLint the source code:\n\n```shell\nyarn test:lint\n```\n\nBuild:\n\n```shell\nyarn build\n```\n\nA successful build run does not produce any message on the terminal.\n\n## Integration test\n\nIntegration tests run against a Trino server running on your workstation.\n\nRequirements:\n\n* [kind](https://kind.sigs.k8s.io/ )\n* [kubectl](https://kubernetes.io/docs/reference/kubectl/)\n\nCreate a cluster:\n\n```shell\nkind create cluster\n```\n\nDeploy Trino:\n\n```shell\nkubectl apply -f tests/it/trino.yml\n```\n\nWait for pods to be ready:\n\n```shell\nkubectl wait --for=condition=ready pods -n trino-system --all --timeout=120s\n```\n\nEnsure Trino is running and available on port `8080`. Run the following \ncommand in a separate terminal:\n\n```shell\nkubectl -n trino-system port-forward svc/trino 8080:8080\n```\n\nRun tests:\n\n```shell\nyarn test:it --testTimeout=60000\n```\n\nOutput should look similar to the following:\n\n```text\n PASS  tests/it/client.spec.ts\n  trino\n    ✓ exhaust query results (1567 ms)\n    ✓ close running query (200 ms)\n    ✓ cancel running query (17 ms)\n    ✓ get query info (1 ms)\n    ✓ client extra header propagation\n    ✓ query request header propagation (88 ms)\n    ✓ QueryResult has error info\n    ✓ QueryInfo has failure info (1 ms)\n    ✓ prepare statement (98 ms)\n    ✓ multiple prepare statement (432 ms)\n\nTest Suites: 1 passed, 1 total\nTests:       10 passed, 10 total\nSnapshots:   0 total\nTime:        3.457 s\nRan all test suites matching /tests\\/it/i.\n```\n\nRemove the cluster:\n\n```shell\nkind delete cluster\n```\n\n## Contributing\n\nFollow the [Trino contribution guidelines](https://trino.io/development/process)\nand contact us on Slack and GitHub.\n\nCopyright \n[Trino JS Client contributors](https://github.com/trinodb/trino-js-client/graphs/contributors) 2022-present\n\n## Releasing\n\nReleases are automated with GitHub Actions and only require a pull request\nthat updates the version in `package.json`. For example, see\n[PR 723](https://github.com/trinodb/trino-js-client/pull/723)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrinodb%2Ftrino-js-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrinodb%2Ftrino-js-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrinodb%2Ftrino-js-client/lists"}