mirror of
https://github.com/hanzo-ds/pool.git
synced 2026-10-30 20:37:50 +00:00
The wire protocol was the last holdout and it was not cosmetic: the Hanzo Datastore server reads X-Datastore-User, and answers a request bearing X-ClickHouse-User with 401. Verified against the live server, both directions. So a client still sending the old headers is not merely off-brand, it cannot authenticate over HTTP. Everything else follows: types, dialects, error modules, docstrings and doc links now name Datastore, and doc URLs point at docs.hanzo.ai/datastore rather than the upstream vendor's site. Zero occurrences of the old name remain. Still cut from the pinned upstream version, so behaviour is unchanged.
38 lines
942 B
ReStructuredText
38 lines
942 B
ReStructuredText
Introduction
|
|
============
|
|
|
|
A thread-safe connection pool for Datastore. Inspired by `psycopg2` and using
|
|
`datastore-driver` for connections.
|
|
|
|
Requirements
|
|
------------
|
|
|
|
`datastore-pool` works with Windows and Unix based systems. The package
|
|
requires Python 3.5 and above due to typing.
|
|
|
|
Installation
|
|
------------
|
|
|
|
You can install `datastore-pool` with from PyPi with `pip` or your favorite package manager::
|
|
|
|
pip install datastore-pool
|
|
|
|
Add the ``-U`` switch to update to the current version, if `datastore-pool` is already installed.
|
|
|
|
Quick Start
|
|
-----------
|
|
|
|
Simple initializing a pool and running a query::
|
|
|
|
from datastore_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()
|