{"id":30956086,"url":"https://github.com/hypequery/hypequery","last_synced_at":"2026-03-05T19:15:06.659Z","repository":{"id":288771972,"uuid":"949769895","full_name":"hypequery/hypequery","owner":"hypequery","description":"hypequery - The type-safe analytics backend for ClickHouse","archived":false,"fork":false,"pushed_at":"2026-03-04T20:57:30.000Z","size":7224,"stargazers_count":40,"open_issues_count":5,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-05T01:40:22.964Z","etag":null,"topics":["analytics","clickhouse","clickhouse-client","dashboard","typescript"],"latest_commit_sha":null,"homepage":"https://hypequery.com","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hypequery.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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":"2025-03-17T05:35:01.000Z","updated_at":"2026-03-04T19:56:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"4e1aff61-76c3-4b11-8cf3-062f5cbba301","html_url":"https://github.com/hypequery/hypequery","commit_stats":null,"previous_names":["hypequery/hypequery"],"tags_count":47,"template":false,"template_full_name":null,"purl":"pkg:github/hypequery/hypequery","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hypequery%2Fhypequery","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hypequery%2Fhypequery/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hypequery%2Fhypequery/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hypequery%2Fhypequery/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hypequery","download_url":"https://codeload.github.com/hypequery/hypequery/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hypequery%2Fhypequery/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30144706,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T16:58:46.102Z","status":"ssl_error","status_checked_at":"2026-03-05T16:58:45.706Z","response_time":93,"last_error":"SSL_read: 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":["analytics","clickhouse","clickhouse-client","dashboard","typescript"],"created_at":"2025-09-11T12:03:55.927Z","updated_at":"2026-03-05T19:15:06.603Z","avatar_url":"https://github.com/hypequery.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"\n## hypequery\n\n### The type-safe analytics backend for ClickHouse. Define metrics once, execute them anywhere (inline, HTTP, React, agents), and keep everything backed by your ClickHouse schema.\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://hypequery.com/docs\"\u003eDocs\u003c/a\u003e •\n  \u003ca href=\"https://hypequery.featurebase.app/roadmap\"\u003eRoadmap\u003c/a\u003e •\n  \u003ca href=\"https://github.com/hypequery/hypequery-examples\"\u003eExamples\u003c/a\u003e\n\u003c/p\u003e\n\n\n## Quick Start\n\n```bash\n# No installation needed\nnpx @hypequery/cli init\n```\n\nOr if you have the CLI installed:\n\n```bash\nnpx hypequery init\n```\n\n### Define your type safe queries in TypeScript\n\n```typescript\nimport { initServe, type InferQueryResult } from '@hypequery/serve';\nimport { z } from 'zod';\nimport { db } from './analytics/client.js';\n\nconst serve = initServe({\n  context: () =\u003e ({ db }),\n});\nconst { query } = serve;\n\nexport const api = serve.define({\n  queries: serve.queries({\n    activeUsers: query\n      .describe('List active users')\n      .input(z.object({ region: z.string() }))\n      .query(async ({ ctx, input }) =\u003e\n        ctx.db\n          .table('users')\n          .where('status', 'eq', 'active')\n          .where('region', 'eq', input.region)\n      ),\n  }),\n});\n\n// Export typed helpers for downstream usage\nexport type ActiveUsersResult = InferQueryResult\u003ctypeof api, 'activeUsers'\u003e;\n```\n\n### Execute everywhere\n\n**Inline**\n```typescript\nconst users = await api.execute('activeUsers');\n```\n\n**HTTP API**\n```bash\nGET /api/activeUsers\n```\n\n**React**\n```typescript\nconst { data } = useQuery('activeUsers');\n```\n\nOne definition. Every consumer.\n\n## Why hypequery\n\n- 🔁 Reuse metrics across SSR routes, background jobs, cron tasks, and agents\n- 🧩 Built-in HTTP server with docs + OpenAPI (`hypequery dev`)\n- 🔐 Auth, multi-tenant helpers, and lifecycle hooks\n- ⚡ Query-level caching, logging, streaming, and analytics\n- 🧪 Type-safe execution + schema-aware validation\n\n## CLI\n\n**No installation required** – run commands directly with `npx`:\n\n```bash\n# Scaffold analytics folder + env vars\nnpx @hypequery/cli init\n\n# Dev server with docs \u0026 OpenAPI\nnpx @hypequery/cli dev\n\n# Regenerate schema types\nnpx @hypequery/cli generate\n```\n\nOr install for shorter commands:\n\n```bash\nnpm install -D @hypequery/cli\n\n# Then use:\nnpx hypequery init\nnpx hypequery dev\n```\n\nSee the [CLI documentation](https://github.com/hypequery/hypequery/tree/main/packages/cli#readme) for all options.\n\n## Features\n\n- **Type-safe definitions** – strong typing for inputs, outputs, joins, filters\n- **SQL expression helpers** – `raw`, `rawAs`, `selectExpr`, `toDateTime`, etc.\n- **Advanced filtering** – predicate builders, nested `whereGroup`, custom operators\n- **Caching \u0026 observability** – SWR cache modes, deduplication, query logging\n- **Streaming** – Web Streams for large datasets\n\n## License\n\nCopyright 2026 hypequery\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\nSee [LICENSE](LICENSE) for the full license text.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhypequery%2Fhypequery","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhypequery%2Fhypequery","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhypequery%2Fhypequery/lists"}