Metadata-Version: 2.4
Name: pipelantic-sql
Version: 0.6.0
Summary: PostgreSQL reference SQL execution plugin for Pipelantic.
Author-email: Odo Matthews <odosmatthews@gmail.com>
License-Expression: MIT
Requires-Python: >=3.11
Requires-Dist: pipelantic<0.7,>=0.6.0
Requires-Dist: psycopg[binary]<4,>=3.1
Requires-Dist: sqlalchemy<3,>=2.0
Provides-Extra: sqlite
Description-Content-Type: text/markdown

# pipelantic-sql

PostgreSQL reference SQL execution plugin for [Pipelantic](https://github.com/eddiethedean/pipelantic).

```bash
pip install pipelantic-sql
# or: pip install 'pipelantic[sql]'
export PIPELANTIC_SQL_URL=postgresql+psycopg://user:pass@localhost:5432/pipelantic
# SQLite is fine for demos only:
# export PIPELANTIC_SQL_URL=sqlite+pysqlite:///:memory:
```

Uses SQLAlchemy Core. Driver dependencies stay out of `pipelantic` core.

## Wiring

```python
from pipelantic import Profile

Profile(name="sql-prod", sql_engine="sql")
```

Register `@Transformation.implementation("sql")` handlers that take
`RelationRef` inputs and return SQL query handles (not fetched rows).

## Capabilities (0.6)

- SQL→SQL fusion without intermediate Python row fetch
- Durable run-scoped staging tables (not session TEMP)
- Insert-select / CTAS-style publication
- Fail-closed planning when required capabilities are missing

**Not included:** `MERGE` / upsert (`sql_merge=False`). Requiring merge fails
at planning.

## Examples

```bash
python examples/sql_to_sql.py
python examples/sql_boundary_hybrid.py
python examples/sql_transactional_write.py
python examples/sql_failure_recovery.py
```
