{"id":18320554,"url":"https://github.com/chdb-io/chdb-node","last_synced_at":"2025-06-10T17:07:16.240Z","repository":{"id":163994155,"uuid":"637814534","full_name":"chdb-io/chdb-node","owner":"chdb-io","description":"Native NodeJS bindings for chDB, an in-process SQL OLAP Engine powered by ClickHouse","archived":false,"fork":false,"pushed_at":"2025-06-03T02:50:43.000Z","size":363,"stargazers_count":36,"open_issues_count":6,"forks_count":6,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-06-03T14:32:30.770Z","etag":null,"topics":["chdb","clickhouse","ffi","napi","nodejs","olap"],"latest_commit_sha":null,"homepage":"https://chdb.io","language":"C++","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,"zenodo":null},"funding":{"github":["chdb-io"]}},"created_at":"2023-05-08T13:16:52.000Z","updated_at":"2025-06-03T02:47:25.000Z","dependencies_parsed_at":"2023-11-13T00:27:02.193Z","dependency_job_id":"a87d5233-f6f4-4e72-b207-f367f1222967","html_url":"https://github.com/chdb-io/chdb-node","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chdb-io%2Fchdb-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chdb-io%2Fchdb-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chdb-io%2Fchdb-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chdb-io%2Fchdb-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chdb-io","download_url":"https://codeload.github.com/chdb-io/chdb-node/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chdb-io%2Fchdb-node/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259114471,"owners_count":22807244,"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":["chdb","clickhouse","ffi","napi","nodejs","olap"],"created_at":"2024-11-05T18:16:42.089Z","updated_at":"2025-06-10T17:07:16.222Z","avatar_url":"https://github.com/chdb-io.png","language":"C++","readme":"\u003cimg src=\"https://avatars.githubusercontent.com/u/132536224\" width=130 /\u003e\n\n[![npm version](https://badge.fury.io/js/chdb.svg)](https://badge.fury.io/js/chdb)\n\n# chdb-node\n[chDB](https://github.com/chdb-io/chdb) nodejs bindings.\n\n### Install\n\n```bash\nnpm i chdb\n```\n\n### Usage\n\n```javascript\nconst { query, Session } = require(\"chdb\");\n\nvar ret;\n\n// Test standalone query\nret = query(\"SELECT version(), 'Hello chDB', chdb()\", \"CSV\");\nconsole.log(\"Standalone Query Result:\", ret);\n\n// Test session query\n// Create a new session instance\nconst session = new Session(\"./chdb-node-tmp\");\nret = session.query(\"SELECT 123\", \"CSV\")\nconsole.log(\"Session Query Result:\", ret);\nret = session.query(\"CREATE DATABASE IF NOT EXISTS testdb;\" +\n    \"CREATE TABLE IF NOT EXISTS testdb.testtable (id UInt32) ENGINE = MergeTree() ORDER BY id;\");\n\nsession.query(\"USE testdb; INSERT INTO testtable VALUES (1), (2), (3);\")\n\nret = session.query(\"SELECT * FROM testtable;\")\nconsole.log(\"Session Query Result:\", ret);\n\n// If an error occurs, it will be thrown\ntry {\n    session.query(\"SELECT * FROM non_existent_table;\", \"CSV\");\n}\ncatch (e) {\n    console.log(\"Error:\", e.message);\n}\n\n// Clean up the session\nsession.cleanup();\n\n```\n\n#### Build from source\n\n```bash\nnpm run libchdb\nnpm install\nnpm run test\n```\n","funding_links":["https://github.com/sponsors/chdb-io"],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchdb-io%2Fchdb-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchdb-io%2Fchdb-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchdb-io%2Fchdb-node/lists"}