{"id":27933444,"url":"https://github.com/timescale/timescaledb-ts","last_synced_at":"2025-05-07T04:58:45.486Z","repository":{"id":277589770,"uuid":"913956167","full_name":"timescale/timescaledb-ts","owner":"timescale","description":"Power your TimescaleDB applications with TypeScript","archived":false,"fork":false,"pushed_at":"2025-04-23T15:42:03.000Z","size":649,"stargazers_count":14,"open_issues_count":12,"forks_count":3,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-05-07T04:58:39.880Z","etag":null,"topics":["integration","orm","plugin","sequelize","time","timescaledb","typeorm","typescript"],"latest_commit_sha":null,"homepage":"https://www.timescale.com","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/timescale.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"docs/CODE_OF_CONDUCT.md","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":"2025-01-08T17:10:13.000Z","updated_at":"2025-05-06T17:42:31.000Z","dependencies_parsed_at":"2025-02-14T19:34:40.322Z","dependency_job_id":"29ac9cdb-3f59-4877-8a76-efaa16d851f6","html_url":"https://github.com/timescale/timescaledb-ts","commit_stats":null,"previous_names":["timescale/timescaledb-ts"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timescale%2Ftimescaledb-ts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timescale%2Ftimescaledb-ts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timescale%2Ftimescaledb-ts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timescale%2Ftimescaledb-ts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timescale","download_url":"https://codeload.github.com/timescale/timescaledb-ts/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252816948,"owners_count":21808704,"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":["integration","orm","plugin","sequelize","time","timescaledb","typeorm","typescript"],"created_at":"2025-05-07T04:58:45.021Z","updated_at":"2025-05-07T04:58:45.475Z","avatar_url":"https://github.com/timescale.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# timescaledb-ts\n\n[![npm version](https://badge.fury.io/js/@timescaledb%2Ftypeorm.svg)](https://badge.fury.io/js/@timescaledb%2Ftypeorm) [![Tests](https://github.com/timescale/timescaledb-ts/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/timescale/timescaledb-ts/actions/workflows/test.yml) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n\u003cp align=center\u003e\n  \u003cimg width=\"80%\" src=\"docs/images/banner-dark.png#gh-dark-mode-only\" alt=\"pgai\"/\u003e\n  \u003cimg width=\"80%\" src=\"docs/images/banner-white.png#gh-light-mode-only\" alt=\"pgai\"/\u003e\n\u003c/p\u003e\n\n\u003cdiv align=center\u003e\n  \u003ch3\u003ePower your TimescaleDB applications with TypeScript\u003c/h3\u003e\n\u003c/div\u003e\n\n\u003cbr/\u003e\n\nWelcome to the [Timescale](https://www.timescale.com/) Typescript library. This library is a collection of packages that help you work with TimescaleDB in a Typescript environment.\n\nIf you are looking to setup this project locally, you can follow the instructions in the [CONTRIBUTING.md](./docs/CONTRIBUTING.md) file.\n\n## Packages\n\n- [@timescaledb/typeorm](./packages/typeorm/README.md) - Official TimescaleDB integration for TypeORM.\n- [@timescaledb/core](./packages/core/README.md) - Migration and query helpers\n- [@timescaledb/schemas](./packages/schemas/README.md) - TimescaleDB object schemas\n- [@timescaledb/utils](./packages/utils/README.md) - utilities and helpers\n\n## Examples\n\n- [Node Sequelize Example](./examples/node-sequelize/README.md) - Using TimescaleDB with Node.js and [Sequelize](https://sequelize.org/)\n- [Node TypeORM Example](./examples/node-typeorm/README.md) - Using TimescaleDB with Node.js and [TypeORM](https://typeorm.io/)\n\n## Guides\n\n- [Getting Started](./docs/guides/getting-started.md) - A guide to getting started with TimescaleDB and this library.\n- [Working with Energy Data](./docs/guides/energy-data.md) - A guide to working with energy data in TimescaleDB.\n- [Working with Candlesticks](./docs/guides/candlesticks.md) - A guide to working with candlestick data in TimescaleDB.\n\n## Feature Compatibility\n\n| Feature                                                                                                                                         | Core | TypeORM | Sequelize            |\n| ----------------------------------------------------------------------------------------------------------------------------------------------- | ---- | ------- | -------------------- |\n| **Core Functions**                                                                                                                              |      |         |                      |\n| [Create Hypertable](https://docs.timescale.com/api/latest/hypertable/create_hypertable/)                                                        | ✅   | ✅ Auto | ✅ Manual (via Core) |\n| [Add Compression](https://docs.timescale.com/api/latest/compression/alter_table_compression/)                                                   | ✅   | ✅ Auto | ✅ Manual (via Core) |\n| [Add Compression Policy](https://docs.timescale.com/api/latest/compression/add_compression_policy/)                                             | ✅   | ✅ Auto | ✅ Manual (via Core) |\n| [Add Retention Policy](https://docs.timescale.com/use-timescale/latest/data-retention/create-a-retention-policy/)                               | ❌   | ❌      | ❌                   |\n| [Continuous Aggregates](https://docs.timescale.com/api/latest/continuous-aggregates/create_materialized_view/)                                  | ✅   | ✅ Auto | ✅ Manual (via Core) |\n| **Hyperfunctions**                                                                                                                              |      |         |                      |\n| [Time Bucket](https://docs.timescale.com/api/latest/hyperfunctions/time_bucket/)                                                                | ✅   | ✅      | ✅ Manual (via Core) |\n| [Candlestick Aggregates](https://docs.timescale.com/api/latest/hyperfunctions/financial-analysis/candlestick_agg/)                              | ✅   | ✅      | ✅ Manual (via Core) |\n| [Stats Aggregates](https://docs.timescale.com/api/latest/hyperfunctions/statistical-and-regression-analysis/stats_agg-one-variable/)            | ❌   | ❌      | ❌                   |\n| [Percentile Approximation](https://docs.timescale.com/api/latest/hyperfunctions/percentile-approximation/uddsketch/)                            | ❌   | ❌      | ❌                   |\n| **Info Views**                                                                                                                                  |      |         |                      |\n| [Chunks](https://docs.timescale.com/api/latest/hypertable/show_chunks/)                                                                         | ❌   | ❌      | ❌                   |\n| [User Defined Actions](https://docs.timescale.com/api/latest/actions/)                                                                          | ❌   | ❌      | ❌                   |\n| [Compression Settings](https://docs.timescale.com/api/latest/compression/)                                                                      | ✅   | ✅      | ✅ Manual (via Core) |\n| [Continuous Aggregates](https://docs.timescale.com/api/latest/continuous-aggregates/create_materialized_view/)                                  | ✅   | ✅      | ✅ Manual (via Core) |\n| [Hierarchical continuous aggregates](https://docs.timescale.com/use-timescale/latest/continuous-aggregates/hierarchical-continuous-aggregates/) | ✅   | ✅      | ✅ Manual (via Core) |\n\nLegend:\n\n- ✅ Supported\n- ❌ Not Supported at this time\n- Auto = Automatic integration with ORM\n- Manual = Manual integration using Core package\n\n## Getting Started\n\n- TypeORM: [README](./packages/typeorm/README.md)\n\nTo get started with TypeORM simply install the package:\n\n```bash\nnpm install typeorm @timescaledb/typeorm\n```\n\nThen you can use the `@Hypertable` decorator to define your hypertables:\n\n```diff\nimport { Entity, PrimaryColumn } from 'typeorm';\n+ import { Hypertable, TimeColumn } from '@timescaledb/typeorm';\n\n+ @Hypertable({ ... })\n@Entity('page_loads')\nexport class PageLoad {\n  @PrimaryColumn({ type: 'varchar' })\n  user_agent!: string;\n\n+  @TimeColumn()\n  time!: Date;\n}\n```\n\nThen you can query a Hypertable using the attached methods:\n\n```typescript\nimport { AppDataSource } from './data-source';\nimport { PageLoad } from './models/PageLoad';\n\nconst repository = AppDataSource.getRepository(PageLoad);\nconst stats = await repository.getTimeBucket({\n  timeRange: {\n    start: new Date('2025-01-01'),\n    end: new Date('2025-01-02'),\n  },\n  where: {\n    user_agent: 'Chrome',\n  },\n  bucket: {\n    interval: '1 hour',\n    metrics: [{ type: 'distinct_count', column: 'user_agent', alias: 'unique_users' }],\n  },\n});\n\nconsole.log(stats);\n// [\n//   { time: '2021-01-01T00:00:00.000Z', unique_users: 5 },\n//   { time: '2021-01-01T01:00:00.000Z', unique_users: 10 },\n//   { time: '2021-01-01T02:00:00.000Z', unique_users: 15 },\n//   ...\n// ]\n```\n\n## License\n\nThe library is available as open source under the terms of the MIT License.\n\n## Code of Conduct\n\nEveryone interacting in the Timescale project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](./docs/CODE_OF_CONDUCT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimescale%2Ftimescaledb-ts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimescale%2Ftimescaledb-ts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimescale%2Ftimescaledb-ts/lists"}