zeekay fe90b4c627 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:54 -07:00
2021-04-23 11:25:08 +03:00
2023-02-01 18:45:32 +03:00
2023-06-30 11:29:31 +03:00
2017-05-13 10:32:36 +03:00

Datastore Python Driver
========================

.. image:: https://img.shields.io/pypi/v/datastore-driver.svg
    :target: https://pypi.org/project/datastore-driver

.. image:: https://coveralls.io/repos/github/mymarilyn/datastore-driver/badge.svg?branch=master
    :target: https://coveralls.io/github/mymarilyn/datastore-driver?branch=master

.. image:: https://img.shields.io/pypi/l/datastore-driver.svg
    :target: https://pypi.org/project/datastore-driver

.. image:: https://img.shields.io/pypi/pyversions/datastore-driver.svg
    :target: https://pypi.org/project/datastore-driver

.. image:: https://img.shields.io/pypi/dm/datastore-driver.svg
    :target: https://pypi.org/project/datastore-driver

.. image:: https://github.com/mymarilyn/datastore-driver/actions/workflows/actions.yml/badge.svg
   :target: https://github.com/mymarilyn/datastore-driver/actions/workflows/actions.yml

Datastore Python Driver with native (TCP) interface support.

Asynchronous wrapper is available here: https://github.com/mymarilyn/aioch

Features
========

- External data for query processing.

- Query settings.

- Compression support.

- TLS support.

- Types support:

  * Float32/64
  * [U]Int8/16/32/64/128/256
  * Date/Date32/DateTime('timezone')/DateTime64('timezone')
  * String/FixedString(N)
  * Enum8/16
  * Array(T)
  * Nullable(T)
  * Bool
  * UUID
  * Decimal
  * IPv4/IPv6
  * LowCardinality(T)
  * SimpleAggregateFunction(F, T)
  * Tuple(T1, T2, ...)
  * Nested
  * Map(key, value)

- Query progress information.

- Block by block results streaming.

- Reading query profile info.

- Receiving server logs.

- Multiple hosts support.

- Python DB API 2.0 specification support.

- Optional NumPy arrays support.

Documentation
=============

Documentation is available at https://datastore-driver.readthedocs.io.

Usage
=====

There are two ways to communicate with server:

- using pure Client;
- using DB API.

Pure Client example:

    .. code-block:: python

        >>> from datastore_driver import Client
        >>>
        >>> client = Client('localhost')
        >>>
        >>> client.execute('SHOW TABLES')
        [('test',)]
        >>> client.execute('DROP TABLE IF EXISTS test')
        []
        >>> client.execute('CREATE TABLE test (x Int32) ENGINE = Memory')
        []
        >>> client.execute(
        ...     'INSERT INTO test (x) VALUES',
        ...     [{'x': 100}]
        ... )
        1
        >>> client.execute('INSERT INTO test (x) VALUES', [[200]])
        1
        >>> client.execute(
        ...     'INSERT INTO test (x) '
        ...     'SELECT * FROM system.numbers LIMIT %(limit)s',
        ...     {'limit': 3}
        ... )
        []
        >>> client.execute('SELECT sum(x) FROM test')
        [(303,)]

DB API example:

    .. code-block:: python

        >>> from datastore_driver import connect
        >>>
        >>> conn = connect('datastore://localhost')
        >>> cursor = conn.cursor()
        >>>
        >>> cursor.execute('SHOW TABLES')
        >>> cursor.fetchall()
        [('test',)]
        >>> cursor.execute('DROP TABLE IF EXISTS test')
        >>> cursor.fetchall()
        []
        >>> cursor.execute('CREATE TABLE test (x Int32) ENGINE = Memory')
        >>> cursor.fetchall()
        []
        >>> cursor.executemany(
        ...     'INSERT INTO test (x) VALUES',
        ...     [{'x': 100}]
        ... )
        >>> cursor.rowcount
        1
        >>> cursor.executemany('INSERT INTO test (x) VALUES', [[200]])
        >>> cursor.rowcount
        1
        >>> cursor.execute(
        ...     'INSERT INTO test (x) '
        ...     'SELECT * FROM system.numbers LIMIT %(limit)s',
        ...     {'limit': 3}
        ... )
        >>> cursor.rowcount
        0
        >>> cursor.execute('SELECT sum(x) FROM test')
        >>> cursor.fetchall()
        [(303,)]

License
=======

Datastore Python Driver is distributed under the `MIT license
<http://www.opensource.org/licenses/mit-license.php>`_.
S
Description
Hanzo Datastore Python driver — native protocol
Readme MIT
2.1 MiB
Languages
Python 96.3%
Cython 3.7%