{"id":16451064,"url":"https://github.com/auxten/chdb-server","last_synced_at":"2025-04-27T15:34:45.058Z","repository":{"id":241437917,"uuid":"805764544","full_name":"auxten/chdb-server","owner":"auxten","description":"Standalone chDB server by chdb-go","archived":false,"fork":false,"pushed_at":"2024-05-27T08:00:41.000Z","size":201,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-23T23:47:44.639Z","etag":null,"topics":["chdb","clickhouse","golang"],"latest_commit_sha":null,"homepage":"","language":"HTML","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/auxten.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}},"created_at":"2024-05-25T11:49:07.000Z","updated_at":"2025-04-04T20:16:20.000Z","dependencies_parsed_at":"2024-05-28T10:55:05.799Z","dependency_job_id":"ef5682e5-853a-41f7-a475-f4a857922765","html_url":"https://github.com/auxten/chdb-server","commit_stats":null,"previous_names":["auxten/chdb-server"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/auxten%2Fchdb-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/auxten%2Fchdb-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/auxten%2Fchdb-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/auxten%2Fchdb-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/auxten","download_url":"https://codeload.github.com/auxten/chdb-server/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251163003,"owners_count":21545861,"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","golang"],"created_at":"2024-10-11T10:07:06.953Z","updated_at":"2025-04-27T15:34:40.049Z","avatar_url":"https://github.com/auxten.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# chDB Server\n\nThis project is a Go-based web server that integrates with the [chDB-go](https://github.com/chdb-io/chdb-go) and provides a web interface for executing database queries. It embeds the static file `play.html` directly within the binary for easy distribution and deployment.\n\n![chDB Server](doc/demo.png)\n\n## Features\n\n- **Query Execution**: Allows users to execute queries against a CHDB database.\n- **Session Management**: Persists the database connection across multiple queries.\n- **Static Content**: Serves a static HTML file (`play.html`) embedded within the executable.\n\n## Prerequisites\n\nBefore you start, ensure you have the following installed:\n- Go 1.16 or higher\n- libchdb\n\n```bash\ncurl -sL https://lib.chdb.io | bash\n```\n\n## Installation\n\n1. Go Install\n\n```bash\ngo install github.com/auxten/chdb-server@latest\n$GOPATH/bin/chdb-server\n```\n\n2. Build from source\n\n```bash\ngit clone https://github.com/auxten/chdb-server.git\nmake build\n./chdb-server\n```\n### Session Path\nYou can configure the server by setting the following environment variables before running the server:\n\n- DATA_PATH: Specifies the directory path for CHDB session data. Defaults to .chdb_data if not set.\n\n## Usage\n\n\nOpen your browser and navigate to `http://localhost:8123` to start querying any data.\n\n#### Create a new database\n\n```sql\nCREATE TABLE users (uid Int16, name String, age Int16) ENGINE=Memory;\n\nINSERT INTO users VALUES (1231, 'John', 33);\nINSERT INTO users VALUES (6666, 'Ksenia', 48);\nINSERT INTO users VALUES (8888, 'Alice', 50);\n\nSELECT * FROM users;\n```\n\n#### Query remote parquet data\n\n```sql\nSELECT RegionID, SUM(AdvEngineID), COUNT(*) AS c, AVG(ResolutionWidth), COUNT(DISTINCT UserID)\n                        FROM url('https://datasets.clickhouse.com/hits_compatible/athena_partitioned/hits_0.parquet') GROUP BY RegionID ORDER BY c DESC LIMIT 10\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fauxten%2Fchdb-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fauxten%2Fchdb-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fauxten%2Fchdb-server/lists"}