{"id":18320560,"url":"https://github.com/chdb-io/chdb-bun","last_synced_at":"2025-04-05T22:31:55.801Z","repository":{"id":163016299,"uuid":"637976663","full_name":"chdb-io/chdb-bun","owner":"chdb-io","description":"bun.sh bindings for chDB, an embedded SQL Engine powered by ClickHouse","archived":false,"fork":false,"pushed_at":"2025-03-19T13:41:38.000Z","size":65,"stargazers_count":16,"open_issues_count":1,"forks_count":2,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-03-19T14:35:48.304Z","etag":null,"topics":["bun","chdb","clickhouse","ffi-bindings"],"latest_commit_sha":null,"homepage":"https://chdb.io","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/chdb-io.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},"funding":{"github":["chdb-io"]}},"created_at":"2023-05-08T20:19:36.000Z","updated_at":"2025-03-19T13:41:44.000Z","dependencies_parsed_at":"2023-11-18T22:38:32.219Z","dependency_job_id":"77ffda68-5cba-4354-8195-b38dc605d153","html_url":"https://github.com/chdb-io/chdb-bun","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chdb-io%2Fchdb-bun","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chdb-io%2Fchdb-bun/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chdb-io%2Fchdb-bun/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chdb-io%2Fchdb-bun/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chdb-io","download_url":"https://codeload.github.com/chdb-io/chdb-bun/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247411237,"owners_count":20934650,"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":["bun","chdb","clickhouse","ffi-bindings"],"created_at":"2024-11-05T18:16:42.578Z","updated_at":"2025-04-05T22:31:55.546Z","avatar_url":"https://github.com/chdb-io.png","language":"TypeScript","funding_links":["https://github.com/sponsors/chdb-io"],"categories":["Language bindings"],"sub_categories":[],"readme":"\u003ca href=\"https://chdb.fly.dev\" target=\"_blank\"\u003e\n  \u003cimg src=\"https://avatars.githubusercontent.com/u/132536224\" width=130 /\u003e\n\u003c/a\u003e\n\n[![chDB-bun](https://github.com/chdb-io/chdb-bun/actions/workflows/bun-test.yml/badge.svg)](https://github.com/chdb-io/chdb-bun/actions/workflows/bun-test.yml)\n\n# chdb-bun \u003cimg src=\"https://user-images.githubusercontent.com/1423657/236928733-43e4f74e-5cff-4b3f-8bb7-20df58e10829.png\" height=20 /\u003e\nExperimental [chDB](https://github.com/chdb-io/chdb) FFI bindings for the [bun runtime](https://bun.sh)\n### Status\n\n- experimental, unstable, subject to changes\n- requires [`libchdb`](https://github.com/chdb-io/chdb) on the system\n- requires `gcc` or `clang`\n\n#### Build binding\n```bash\nbun run build\nbun run example.ts\n```\n\n#### Usage\n\n#### Query(query, *format) (ephemeral)\n```javascript\nimport { query } from 'chdb-bun';\n\n// Query (ephemeral)\nvar result = query(\"SELECT version()\", \"CSV\");\nconsole.log(result); // 23.10.1.1\n```\n\n#### Session.Query(query, *format)\n```javascript\nimport { Session } from 'chdb-bun';\nconst sess = new Session('./chdb-bun-tmp');\n\n// Query Session (persistent)\nsess.query(\"CREATE FUNCTION IF NOT EXISTS hello AS () -\u003e 'Hello chDB'\", \"CSV\");\nvar result = sess.query(\"SELECT hello()\", \"CSV\");\nconsole.log(result);\n\n// Before cleanup, you can find the database files in `./chdb-bun-tmp`\n\nsess.cleanup(); // cleanup session, this will delete the database\n```\n\n\u003cbr\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchdb-io%2Fchdb-bun","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchdb-io%2Fchdb-bun","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchdb-io%2Fchdb-bun/lists"}