Skip to main content

ClickHouse Pool for Python

PyPI PyPI - License Read the Docs

A thread-safe connection pool for ClickHouse. Inspired by psycopg2 and using clickhouse-driver for connections.

Installation

pip install clickhouse-pool

Quick Start

from clickhouse_pool import ChPool

pool = ChPool()

with pool.get_client() as client:
    # execute sql and print the result
    result = client.execute("SELECT * FROM system.numbers LIMIT 5")
    print(result)

# always close all connections in the pool once you're done with it
pool.cleanup()

Connection Pool Size

To change the connection pool size,

pool = ChPool(connections_min=20, connections_max=40)

with pool.get_client() as client:
    result = client.execute("SELECT * FROM system.numbers LIMIT 5")
    print(result)

# always close all connections in the pool once you're done with it
pool.cleanup()

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

clickhouse-pool-0.3.1.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

clickhouse_pool-0.3.1-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file clickhouse-pool-0.3.1.tar.gz.

File metadata

  • Download URL: clickhouse-pool-0.3.1.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3

File hashes

Hashes for clickhouse-pool-0.3.1.tar.gz
Algorithm Hash digest
SHA256 77a12b86154540e2cdf57988585d4d5834d987a7c8d6a4145b1aca154a3d41a1
MD5 fae5531596268c5f8df7e6daa5214d3e
BLAKE2b-256 98d563b963ef53254594c48e4473013eb511648f34a94ee5519cf7fe34fc7525

See more details on using hashes here.

File details

Details for the file clickhouse_pool-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: clickhouse_pool-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3

File hashes

Hashes for clickhouse_pool-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dd706613f43ce59528a905206de9ed7b477f154546ddc5318dc48df3c05e97af
MD5 058485bb558364255ea3b5ba494d18d7
BLAKE2b-256 d3fe73d387316e7ad6f091d642f7dfd95e2b7a5eef106cc8aad61a809bca6c83

See more details on using hashes here.

Release history Release notifications | RSS feed

0.6.1

2 files

0.6.0

2 files

0.5.3

2 files

0.5.0

2 files

0.4.3

2 files

0.4.2

2 files

0.4.0

2 files

This release

0.3.1 This release

2 files

0.3.0

2 files

0.2.0

2 files

0.1.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page