{"id":42860184,"url":"https://github.com/juelite/ch_pool","last_synced_at":"2026-01-30T12:36:01.310Z","repository":{"id":57566356,"uuid":"228575563","full_name":"juelite/ch_pool","owner":"juelite","description":"golang clickhouse connect pool","archived":false,"fork":false,"pushed_at":"2019-12-17T09:27:35.000Z","size":2,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-20T13:37:41.087Z","etag":null,"topics":["ch","clickhouse","clickhouse-client","clickhouse-pool","golang-clickhouse"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/juelite.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-12-17T09:02:09.000Z","updated_at":"2020-12-02T15:04:44.000Z","dependencies_parsed_at":"2022-08-27T18:41:25.406Z","dependency_job_id":null,"html_url":"https://github.com/juelite/ch_pool","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/juelite/ch_pool","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juelite%2Fch_pool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juelite%2Fch_pool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juelite%2Fch_pool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juelite%2Fch_pool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/juelite","download_url":"https://codeload.github.com/juelite/ch_pool/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juelite%2Fch_pool/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28912911,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T12:13:43.263Z","status":"ssl_error","status_checked_at":"2026-01-30T12:13:22.389Z","response_time":66,"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":["ch","clickhouse","clickhouse-client","clickhouse-pool","golang-clickhouse"],"created_at":"2026-01-30T12:35:59.422Z","updated_at":"2026-01-30T12:36:01.305Z","avatar_url":"https://github.com/juelite.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## golang clickhouse connection pool\n\n### click house connection package\n\n```text\n    github.com/jmoiron/sqlx\n```\n\n### install\n\n```shell script\ngo get -u github.com/juelite/ch_pool\n```\n\n### use\n\n\n- init click house pool \n\n```go\n\n\nvar (\n\tchPool *ChPool\n\terr error\n)\n\nfunc init() {\n\tdsn := \"tcp://192.168.1.50:9000?database=big_data\u0026read_timeout=3600\u0026write_timeout=3600\u0026alt_hosts=192.168.1.51:9000,192.168.1.52:9000\"\n\t\n\tchPool, err = NewChPool(10, 100, 1800, func() (db *sqlx.DB, e error) {\n\t\treturn sqlx.Open(\"clickhouse\", dsn)\n\t})\n\tif err != nil {\n\t\tlog.Println(err.Error())\n\t\tpanic(err)\n\t} else {\n\t\tlog.Printf(\"click house连接成功！%s\\n\", dsn)\n\t}\n}\n\n```\n\n- business logic use click house connect\n\n```go\nfunc main() {\n    conn, err := chPool.GetConn()\n    if err != nil {\n        return\n    }\n    defer chPool.Release(conn)\n\n    sql := \"select column1, column2 from database.table limit 1\"\n\n    rows, err := chConn.Query(sql)\n\n    // todo handle error\n    // todo deal return data\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuelite%2Fch_pool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjuelite%2Fch_pool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuelite%2Fch_pool/lists"}