continuo-postgres-adapter 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- continuo_postgres_adapter-0.2.0/.gitignore +11 -0
- continuo_postgres_adapter-0.2.0/PKG-INFO +51 -0
- continuo_postgres_adapter-0.2.0/README.md +36 -0
- continuo_postgres_adapter-0.2.0/continuo_postgres_adapter/__init__.py +0 -0
- continuo_postgres_adapter-0.2.0/continuo_postgres_adapter/adapter.py +700 -0
- continuo_postgres_adapter-0.2.0/pyproject.toml +57 -0
- continuo_postgres_adapter-0.2.0/tests/__init__.py +0 -0
- continuo_postgres_adapter-0.2.0/tests/conftest.py +114 -0
- continuo_postgres_adapter-0.2.0/tests/test_adapter_postgres_validation.py +199 -0
- continuo_postgres_adapter-0.2.0/tests/test_adapter_runtime_postgres.py +551 -0
- continuo_postgres_adapter-0.2.0/tests/test_integration_postgres_validation.py +450 -0
- continuo_postgres_adapter-0.2.0/tests/test_integration_runtime_postgres.py +384 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: continuo-postgres-adapter
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: Postgres warehouse adapter for Continuo: validation and python-node runtime.
|
|
5
|
+
Author: Simone Carolini
|
|
6
|
+
Maintainer: Simone Carolini
|
|
7
|
+
Classifier: Development Status :: 4 - Beta
|
|
8
|
+
Classifier: Intended Audience :: Developers
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
10
|
+
Requires-Python: >=3.14
|
|
11
|
+
Requires-Dist: continuo-engine-contract==0.7.3
|
|
12
|
+
Requires-Dist: psycopg2-binary==2.9.12
|
|
13
|
+
Requires-Dist: pyarrow==25.0.1
|
|
14
|
+
Description-Content-Type: text/markdown
|
|
15
|
+
|
|
16
|
+
# continuo-postgres-adapter
|
|
17
|
+
|
|
18
|
+
Postgres engine-adapter library for Continuo python nodes. `PostgresAdapter`
|
|
19
|
+
implements `continuo_engine_contract.port.WarehouseAdapter` (from the
|
|
20
|
+
`continuo-engine-contract` package) — one class covering both the data plane
|
|
21
|
+
(`fetch` / `ensure_table` / `load`) and release-time validation
|
|
22
|
+
(`ensure_schema` / `drop_schema` / `build_empty_from_sql` /
|
|
23
|
+
`build_empty_from_columns` / `clone_empty_from_prod` / `check_binds`) — and
|
|
24
|
+
registers itself under entry-point group `continuo_engine.adapters` as
|
|
25
|
+
`postgres`.
|
|
26
|
+
|
|
27
|
+
Connection env: `POSTGRES_HOST`, `POSTGRES_DB`, `POSTGRES_USER` (required);
|
|
28
|
+
`POSTGRES_PORT` (default 5432), `POSTGRES_PASSWORD` (default empty).
|
|
29
|
+
|
|
30
|
+
The connection runs with `autocommit = True`; every method owns its
|
|
31
|
+
transaction explicitly. `load()` and `ensure_table()` open an explicit
|
|
32
|
+
`BEGIN` around their statements and `COMMIT`/`ROLLBACK` themselves, so a
|
|
33
|
+
mid-sequence failure leaves no partial change. `fetch()` executes a single
|
|
34
|
+
read and commits (or rolls back on error), never leaving an open transaction
|
|
35
|
+
dangling.
|
|
36
|
+
|
|
37
|
+
The `config:` index vocabulary is the union of the two vocabularies this
|
|
38
|
+
adapter inherited from the merge: `columns`, `unique`, `type`, and `name`,
|
|
39
|
+
with the strictest check from each side applied. The derived index name is
|
|
40
|
+
built from the table and the column list only — `type` and `unique` are not
|
|
41
|
+
folded into it, so two index entries on the same columns that differ only in
|
|
42
|
+
`type` (or only in `unique`) collide on that derived name and are rejected as
|
|
43
|
+
a duplicate. Give one of them an explicit `name:` when that is genuinely
|
|
44
|
+
intended.
|
|
45
|
+
|
|
46
|
+
Verification tier: unit tests are mock-free pure-logic tests (type-grammar
|
|
47
|
+
validation, Arrow table construction from rows); DDL/transactional behavior
|
|
48
|
+
(schema/table creation, load truncate+insert+rollback, validation DDL) is
|
|
49
|
+
verified against a live postgres:16 engine in
|
|
50
|
+
`tests/test_integration_runtime_postgres.py` and
|
|
51
|
+
`tests/test_integration_postgres_validation.py`.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# continuo-postgres-adapter
|
|
2
|
+
|
|
3
|
+
Postgres engine-adapter library for Continuo python nodes. `PostgresAdapter`
|
|
4
|
+
implements `continuo_engine_contract.port.WarehouseAdapter` (from the
|
|
5
|
+
`continuo-engine-contract` package) — one class covering both the data plane
|
|
6
|
+
(`fetch` / `ensure_table` / `load`) and release-time validation
|
|
7
|
+
(`ensure_schema` / `drop_schema` / `build_empty_from_sql` /
|
|
8
|
+
`build_empty_from_columns` / `clone_empty_from_prod` / `check_binds`) — and
|
|
9
|
+
registers itself under entry-point group `continuo_engine.adapters` as
|
|
10
|
+
`postgres`.
|
|
11
|
+
|
|
12
|
+
Connection env: `POSTGRES_HOST`, `POSTGRES_DB`, `POSTGRES_USER` (required);
|
|
13
|
+
`POSTGRES_PORT` (default 5432), `POSTGRES_PASSWORD` (default empty).
|
|
14
|
+
|
|
15
|
+
The connection runs with `autocommit = True`; every method owns its
|
|
16
|
+
transaction explicitly. `load()` and `ensure_table()` open an explicit
|
|
17
|
+
`BEGIN` around their statements and `COMMIT`/`ROLLBACK` themselves, so a
|
|
18
|
+
mid-sequence failure leaves no partial change. `fetch()` executes a single
|
|
19
|
+
read and commits (or rolls back on error), never leaving an open transaction
|
|
20
|
+
dangling.
|
|
21
|
+
|
|
22
|
+
The `config:` index vocabulary is the union of the two vocabularies this
|
|
23
|
+
adapter inherited from the merge: `columns`, `unique`, `type`, and `name`,
|
|
24
|
+
with the strictest check from each side applied. The derived index name is
|
|
25
|
+
built from the table and the column list only — `type` and `unique` are not
|
|
26
|
+
folded into it, so two index entries on the same columns that differ only in
|
|
27
|
+
`type` (or only in `unique`) collide on that derived name and are rejected as
|
|
28
|
+
a duplicate. Give one of them an explicit `name:` when that is genuinely
|
|
29
|
+
intended.
|
|
30
|
+
|
|
31
|
+
Verification tier: unit tests are mock-free pure-logic tests (type-grammar
|
|
32
|
+
validation, Arrow table construction from rows); DDL/transactional behavior
|
|
33
|
+
(schema/table creation, load truncate+insert+rollback, validation DDL) is
|
|
34
|
+
verified against a live postgres:16 engine in
|
|
35
|
+
`tests/test_integration_runtime_postgres.py` and
|
|
36
|
+
`tests/test_integration_postgres_validation.py`.
|
|
File without changes
|