Metadata-Version: 2.4
Name: dbt-polnor
Version: 0.1.0
Summary: dbt adapter for Polnor — run dbt models on a Polnor SQL warehouse (DuckDB reads + Spark Iceberg writes).
Author-email: Polnor <contact@polnor.net>
License: Apache-2.0
Project-URL: Homepage, https://polnor.net
Project-URL: Documentation, https://docs.polnor.net/sdk/dbt-polnor
Project-URL: Source, https://github.com/polnor/polnor
Keywords: polnor,dbt,dbt-adapter,lakehouse,iceberg
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Topic :: Database
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: polnor>=1.0
Requires-Dist: dbt-core<2.0,>=1.7
Requires-Dist: dbt-adapters>=1.0
Requires-Dist: dbt-common>=1.0
Provides-Extra: test
Requires-Dist: pytest>=7; extra == "test"
Requires-Dist: pytest-dbt-adapter>=0.6; extra == "test"

# dbt-polnor

[dbt](https://www.getdbt.com) adapter for [Polnor](https://polnor.net) —
run your dbt models on a Polnor SQL warehouse with Iceberg tables, the
same way you'd run them on Databricks or Snowflake.

## Install

```bash
pip install dbt-polnor
```

This installs `dbt-core>=1.7`, `polnor>=1.0`, and the adapter glue.

## Configure

In `~/.dbt/profiles.yml`:

```yaml
my_project:
  target: dev
  outputs:
    dev:
      type: polnor
      host: https://api.polnor.net
      token: "{{ env_var('POLNOR_TOKEN') }}"
      warehouse_id: wh-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
      workspace_id: ws-xxxxxxxx                # optional
      database: polnor                          # Spark catalog name (= Lakekeeper warehouse)
      schema: demo                              # default namespace for unqualified models
      threads: 4
```

Or interactively :

```bash
dbt init my_project
# select polnor as the database
```

## Use

Anywhere your dbt project does :

```bash
dbt run
dbt test
dbt build
dbt docs generate
```

Models with `materialized='table'` get `CREATE TABLE ... USING iceberg`
through the Spark sidecar; `materialized='view'` becomes a SQL view via
Spark. Incremental models work via Spark's `MERGE INTO`.

## What's supported (V0.1)

| Feature | Status |
|---|---|
| `materialized='table'` (Iceberg)  | ✅ |
| `materialized='view'`             | ✅ |
| `materialized='incremental'`      | 🟡 append + merge (no `delete+insert` yet) |
| Sources + ref()                   | ✅ |
| Tests (generic + singular)        | ✅ |
| Snapshots                         | 🟡 V2 |
| Seeds                             | ✅ |
| Macros                            | ✅ |
| `dbt docs generate`               | ✅ |
| Python models (Spark)             | ⏳ V2 |

## Limitations (V1)

- No transaction rollback — Polnor's engine is auto-commit per statement.
- No transient / temporary tables — Iceberg doesn't support them.
- `dbt seed` uses INSERT batches (1k rows / chunk) — for ≫100k rows
  prefer copying CSV to S3 then `CREATE TABLE FROM` directly.

## Links

- Polnor: https://polnor.net
- Core SDK: https://pypi.org/project/polnor/
- SQLAlchemy dialect: https://pypi.org/project/polnor-sqlalchemy/
- Source / issues: https://github.com/polnor/polnor

## License

Apache-2.0.
