Metadata-Version: 2.4
Name: tigrbl_engine_clickhouse
Version: 0.1.1.dev19
Summary: Tigrbl engine plugin providing ClickHouse database support.
Author-email: Jacob Stewart <jacob@swarmauri.com>
License: Apache-2.0
Keywords: tigrbl,engine,plugin,clickhouse,database,analytics
Classifier: Development Status :: 1 - Planning
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Environment :: Plugins
Classifier: Intended Audience :: Developers
Classifier: Topic :: Database
Classifier: Topic :: Software Development :: Libraries
Requires-Python: <3.13,>=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: tigrbl>=0.3.0.dev4
Requires-Dist: clickhouse-connect>=0.6.0
Dynamic: license-file

# tigrbl_engine_clickhouse

A ClickHouse engine plugin for **tigrbl**. This package registers a new engine
kind `"clickhouse"` that tigrbl auto‑discovers via the `tigrbl.engine` entry‑point group.

> Both classes in this package are **subclasses of tigrbl's first‑class objects**.

## Installation

```bash
pip install tigrbl_engine_clickhouse
```

## Usage

```python
from tigrbl.engine.engine_spec import EngineSpec

spec = EngineSpec(kind="clickhouse", mapping={
    "host": "localhost",
    "port": 8123,
    "username": "default",
    "password": "",
    "database": "default",
    "secure": False,
})
eng, make_session = spec.build()   # resolved via entry-points
s = make_session()                 # returns a ClickHouseSession (TigrblSessionBase subclass)

# Example query
rows = await s._execute_impl("SELECT 1 AS x")
print(rows)
await s.close()
```

### How it’s wired

- `pyproject.toml` declares the entry‑point:
  ```toml
  [project.entry-points."tigrbl.engine"]
  clickhouse = "tigrbl_engine_clickhouse:register"
  ```
- `register()` (in `__init__.py`) calls `tigrbl.engine.registry.register_engine("clickhouse", clickhouse_engine)`.
- `ClickHouseEngine` subclasses `tigrbl._concrete._engine.Engine`.
- `ClickHouseSession` subclasses `tigrbl.session.base.TigrblSessionBase` and uses `clickhouse_connect`.
