zeekay 7793e23d09 ci: drop the Gitea mirror-sync nudge
Superseded: the Hanzo GitHub App pushes a webhook, so the forge tracks GitHub
without a per-repo workflow. This file called git.hanzo.ai/api/v1/.../mirror-sync
— a Gitea API for a system we no longer drive — and would sit inert in every repo.

One mechanism, in one place, instead of ~350 copies of a cron.
2026-07-27 10:22:58 -07:00
2020-06-23 23:23:12 -04:00
2020-06-23 16:53:07 -04:00

Datastore Pool for Python

PyPI PyPI - License Read the Docs

A thread-safe connection pool for Datastore. Inspired by psycopg2 and using datastore-driver for connections.

Installation

pip install datastore-pool

Quick Start

from datastore_pool import ChPool

# find available settings at https://datastore-driver.readthedocs.io/en/latest/api.html#datastore_driver.Client
pool = ChPool(host="localhost")

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()

Testing Locally

To run tests locally ensure you have an instance of datastore-server running on localhost. The easiest way is to use docker:

docker run -d -p 9000:9000 yandex/datastore-server
poetry run pytest

Building Docs

poetry run sphinx-build -M html docs/source docs/_build
S
Description
Thread-safe connection pool for Hanzo Datastore
Readme
5.9 MiB
Languages
Python 100%