Metadata-Version: 2.4
Name: tigrbl_engine_pgsqli_wal
Version: 0.1.1
Summary: PostgreSQL and SQLite WAL engine plugin for Tigrbl (auto-registered via entry points).
Author-email: Jacob Stewart <jacob@swarmauri.com>
License: Apache-2.0
Project-URL: Homepage, https://github.com/swarmauri/swarmauri-sdk
Project-URL: Repository, https://github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/experimental/tigrbl_engine_pgsqli_wal
Keywords: tigrbl,engine,plugin,postgres,sqlite,wal
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: SQLAlchemy<3.0,>=2.0
Requires-Dist: psycopg[binary]<4.0,>=3.1
Dynamic: license-file

# tigrbl_engine_pgsqli_wal

**Tigrbl engine plugin providing two engines:**

- `postgres_wal` — PostgreSQL via SQLAlchemy + psycopg3
- `sqlite_wal` — SQLite with WAL mode enabled via connection PRAGMAs

The package **auto-registers** with Tigrbl through the `tigrbl.engine` entry-point group.

## Install

```bash
pip install -e .
```

## Usage (inside Tigrbl)

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

# PostgreSQL (DSN or mapping)
spec = EngineSpec(kind="postgres_wal", dsn="postgresql+psycopg://user:pwd@host:5432/db?application_name=tigrbl")

# Or with mapping (the plugin builds the URL)
spec = EngineSpec(kind="postgres_wal", mapping={
  "host": "127.0.0.1", "port": 5432, "user": "user", "pwd": "pwd", "db": "db",
  "application_name": "tigrbl", "pool_size": 10, "max_overflow": 20
})

# SQLite (file path required for WAL)
spec = EngineSpec(kind="sqlite_wal", mapping={"path": "/path/to/db.sqlite", "pool_size": 5})

engine = Engine(spec)
with engine.session() as s:
    s.execute("select 1").all()
```

> Notes:
> - PostgreSQL WAL is a server feature; this plugin tunes connection/session parameters only.
> - SQLite WAL is enabled via `PRAGMA journal_mode=WAL` on each new connection.
