resource-engine-sqlalchemy 0.1.0__tar.gz → 0.1.1__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.
Files changed (41) hide show
  1. {resource_engine_sqlalchemy-0.1.0 → resource_engine_sqlalchemy-0.1.1}/.gitignore +1 -0
  2. {resource_engine_sqlalchemy-0.1.0 → resource_engine_sqlalchemy-0.1.1}/CHANGELOG.md +7 -0
  3. resource_engine_sqlalchemy-0.1.1/PKG-INFO +120 -0
  4. resource_engine_sqlalchemy-0.1.1/README.md +91 -0
  5. {resource_engine_sqlalchemy-0.1.0 → resource_engine_sqlalchemy-0.1.1}/pyproject.toml +2 -2
  6. resource_engine_sqlalchemy-0.1.0/PKG-INFO +0 -34
  7. resource_engine_sqlalchemy-0.1.0/README.md +0 -5
  8. {resource_engine_sqlalchemy-0.1.0 → resource_engine_sqlalchemy-0.1.1}/LICENSE +0 -0
  9. {resource_engine_sqlalchemy-0.1.0 → resource_engine_sqlalchemy-0.1.1}/src/resource_engine_sqlalchemy/__init__.py +0 -0
  10. {resource_engine_sqlalchemy-0.1.0 → resource_engine_sqlalchemy-0.1.1}/src/resource_engine_sqlalchemy/activity.py +0 -0
  11. {resource_engine_sqlalchemy-0.1.0 → resource_engine_sqlalchemy-0.1.1}/src/resource_engine_sqlalchemy/audit.py +0 -0
  12. {resource_engine_sqlalchemy-0.1.0 → resource_engine_sqlalchemy-0.1.1}/src/resource_engine_sqlalchemy/authz.py +0 -0
  13. {resource_engine_sqlalchemy-0.1.0 → resource_engine_sqlalchemy-0.1.1}/src/resource_engine_sqlalchemy/documents.py +0 -0
  14. {resource_engine_sqlalchemy-0.1.0 → resource_engine_sqlalchemy-0.1.1}/src/resource_engine_sqlalchemy/idempotency.py +0 -0
  15. {resource_engine_sqlalchemy-0.1.0 → resource_engine_sqlalchemy-0.1.1}/src/resource_engine_sqlalchemy/inbox.py +0 -0
  16. {resource_engine_sqlalchemy-0.1.0 → resource_engine_sqlalchemy-0.1.1}/src/resource_engine_sqlalchemy/locks.py +0 -0
  17. {resource_engine_sqlalchemy-0.1.0 → resource_engine_sqlalchemy-0.1.1}/src/resource_engine_sqlalchemy/migration_checks.py +0 -0
  18. {resource_engine_sqlalchemy-0.1.0 → resource_engine_sqlalchemy-0.1.1}/src/resource_engine_sqlalchemy/migrations.py +0 -0
  19. {resource_engine_sqlalchemy-0.1.0 → resource_engine_sqlalchemy-0.1.1}/src/resource_engine_sqlalchemy/outbox.py +0 -0
  20. {resource_engine_sqlalchemy-0.1.0 → resource_engine_sqlalchemy-0.1.1}/src/resource_engine_sqlalchemy/polymorphism.py +0 -0
  21. {resource_engine_sqlalchemy-0.1.0 → resource_engine_sqlalchemy-0.1.1}/src/resource_engine_sqlalchemy/py.typed +0 -0
  22. {resource_engine_sqlalchemy-0.1.0 → resource_engine_sqlalchemy-0.1.1}/src/resource_engine_sqlalchemy/repository.py +0 -0
  23. {resource_engine_sqlalchemy-0.1.0 → resource_engine_sqlalchemy-0.1.1}/src/resource_engine_sqlalchemy/schema.py +0 -0
  24. {resource_engine_sqlalchemy-0.1.0 → resource_engine_sqlalchemy-0.1.1}/src/resource_engine_sqlalchemy/suppressions.py +0 -0
  25. {resource_engine_sqlalchemy-0.1.0 → resource_engine_sqlalchemy-0.1.1}/src/resource_engine_sqlalchemy/unit_of_work.py +0 -0
  26. {resource_engine_sqlalchemy-0.1.0 → resource_engine_sqlalchemy-0.1.1}/src/resource_engine_sqlalchemy/views.py +0 -0
  27. {resource_engine_sqlalchemy-0.1.0 → resource_engine_sqlalchemy-0.1.1}/tests/conftest.py +0 -0
  28. {resource_engine_sqlalchemy-0.1.0 → resource_engine_sqlalchemy-0.1.1}/tests/test_migrations.py +0 -0
  29. {resource_engine_sqlalchemy-0.1.0 → resource_engine_sqlalchemy-0.1.1}/tests/test_postgres.py +0 -0
  30. {resource_engine_sqlalchemy-0.1.0 → resource_engine_sqlalchemy-0.1.1}/tests/test_schema.py +0 -0
  31. {resource_engine_sqlalchemy-0.1.0 → resource_engine_sqlalchemy-0.1.1}/tests/test_sqlalchemy_activity.py +0 -0
  32. {resource_engine_sqlalchemy-0.1.0 → resource_engine_sqlalchemy-0.1.1}/tests/test_sqlalchemy_audit.py +0 -0
  33. {resource_engine_sqlalchemy-0.1.0 → resource_engine_sqlalchemy-0.1.1}/tests/test_sqlalchemy_audit_seal.py +0 -0
  34. {resource_engine_sqlalchemy-0.1.0 → resource_engine_sqlalchemy-0.1.1}/tests/test_sqlalchemy_authz.py +0 -0
  35. {resource_engine_sqlalchemy-0.1.0 → resource_engine_sqlalchemy-0.1.1}/tests/test_sqlalchemy_contracts.py +0 -0
  36. {resource_engine_sqlalchemy-0.1.0 → resource_engine_sqlalchemy-0.1.1}/tests/test_sqlalchemy_documents.py +0 -0
  37. {resource_engine_sqlalchemy-0.1.0 → resource_engine_sqlalchemy-0.1.1}/tests/test_sqlalchemy_exactly_once.py +0 -0
  38. {resource_engine_sqlalchemy-0.1.0 → resource_engine_sqlalchemy-0.1.1}/tests/test_sqlalchemy_locks.py +0 -0
  39. {resource_engine_sqlalchemy-0.1.0 → resource_engine_sqlalchemy-0.1.1}/tests/test_sqlalchemy_polymorphism.py +0 -0
  40. {resource_engine_sqlalchemy-0.1.0 → resource_engine_sqlalchemy-0.1.1}/tests/test_sqlalchemy_tenancy.py +0 -0
  41. {resource_engine_sqlalchemy-0.1.0 → resource_engine_sqlalchemy-0.1.1}/tests/test_sqlalchemy_versions.py +0 -0
@@ -16,3 +16,4 @@ reviews/
16
16
  .coverage.*
17
17
  htmlcov/
18
18
  python-coverage-comment-action.txt
19
+ _build/
@@ -6,6 +6,13 @@ Notable changes to this package, newest first. Versions follow
6
6
 
7
7
  ## Unreleased
8
8
 
9
+ ## 0.1.1 (2026-12-05)
10
+
11
+ Documentation only: no change to the code's behaviour.
12
+
13
+ - The README describes the adapter, with an example that runs, and links to the [documentation site](https://eloisans.github.io/python-resource-engine/)
14
+ - The Documentation link points to the documentation site
15
+
9
16
  ## 0.1.0 (2026-12-05)
10
17
 
11
18
  First release.
@@ -0,0 +1,120 @@
1
+ Metadata-Version: 2.5
2
+ Name: resource-engine-sqlalchemy
3
+ Version: 0.1.1
4
+ Summary: SQLAlchemy persistence adapter (repositories and unit of work) for Resource Engine.
5
+ Project-URL: Homepage, https://github.com/EloiSans/python-resource-engine
6
+ Project-URL: Documentation, https://eloisans.github.io/python-resource-engine/
7
+ Project-URL: Source, https://github.com/EloiSans/python-resource-engine/tree/main/packages/resource-engine-sqlalchemy
8
+ Project-URL: Issues, https://github.com/EloiSans/python-resource-engine/issues
9
+ Project-URL: Changelog, https://github.com/EloiSans/python-resource-engine/blob/main/packages/resource-engine-sqlalchemy/CHANGELOG.md
10
+ License-Expression: Apache-2.0
11
+ License-File: LICENSE
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Framework :: AsyncIO
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Programming Language :: Python :: 3.14
20
+ Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
21
+ Classifier: Typing :: Typed
22
+ Requires-Python: >=3.12
23
+ Requires-Dist: resource-engine<0.2,>=0.1.0
24
+ Requires-Dist: sqlalchemy[asyncio]>=2.0
25
+ Provides-Extra: alembic
26
+ Requires-Dist: alembic-postgresql-enum>=1.8; extra == 'alembic'
27
+ Requires-Dist: alembic>=1.13; extra == 'alembic'
28
+ Description-Content-Type: text/markdown
29
+
30
+ # resource-engine-sqlalchemy
31
+
32
+ [![PyPI](https://img.shields.io/pypi/v/resource-engine-sqlalchemy)](https://pypi.org/project/resource-engine-sqlalchemy/)
33
+ [![Python](https://img.shields.io/pypi/pyversions/resource-engine-sqlalchemy)](https://pypi.org/project/resource-engine-sqlalchemy/)
34
+ [![Docs](https://img.shields.io/badge/docs-site-blue)](https://eloisans.github.io/python-resource-engine/)
35
+
36
+ SQL storage for [Resource Engine](https://pypi.org/project/resource-engine/),
37
+ a framework for business backends you declare instead of writing CRUD,
38
+ permissions, transactions and state transitions for every entity.
39
+
40
+ This adapter stores the resources' records with SQLAlchemy 2 (async), and
41
+ gives the engine the tables it needs around them, in the same transaction as
42
+ each change:
43
+
44
+ - **A generic repository for every resource:** filters, sorting, search,
45
+ pages, `expand` of related records, and permission conditions translated to
46
+ SQL, so a list returns only the rows the caller may see.
47
+ - **A unit of work** that wraps each operation in one transaction.
48
+ - **The transactional outbox and the consumer inbox:** events are stored with
49
+ the change that raised them, and a message is handled once.
50
+ - **Engine tables** for the audit trail (with optional hash seals),
51
+ permission policies, API keys, documents, idempotency keys, job leases and
52
+ the worker's activity, created only when you ask for them.
53
+ - **Alembic support** (`[alembic]`): autogenerate sees the engine's tables
54
+ next to yours, with checks for migrations that would fail on tables that
55
+ hold data.
56
+
57
+ Domain classes stay plain: you map them with SQLAlchemy's imperative mapping
58
+ in the infrastructure layer, so the domain never imports SQLAlchemy. Tested
59
+ on SQLite and PostgreSQL.
60
+
61
+ ## Install
62
+
63
+ ```bash
64
+ pip install resource-engine-sqlalchemy
65
+ pip install "resource-engine-sqlalchemy[alembic]" # with migrations
66
+ ```
67
+
68
+ Add the async driver for your database, such as `aiosqlite` or `asyncpg`.
69
+
70
+ ## Use
71
+
72
+ ```python
73
+ from resource_engine import ResourceManager
74
+ from resource_engine_sqlalchemy import (
75
+ NAMING_CONVENTION,
76
+ engine_tables,
77
+ map_engine,
78
+ unit_of_work_factory,
79
+ )
80
+ from sqlalchemy import Column, Integer, MetaData, String, Table
81
+ from sqlalchemy.ext.asyncio import async_sessionmaker, create_async_engine
82
+ from sqlalchemy.orm import registry as orm_registry
83
+
84
+ from tasks.domain import Task # a plain dataclass
85
+ from tasks.resources import registry # a ResourceRegistry with TaskResource
86
+
87
+ metadata = MetaData(naming_convention=NAMING_CONVENTION)
88
+ mapper_registry = orm_registry(metadata=metadata)
89
+
90
+ tasks_table = Table(
91
+ "tasks",
92
+ metadata,
93
+ Column("id", Integer, primary_key=True, autoincrement=True),
94
+ Column("title", String(200), nullable=False),
95
+ Column("status", String(32), nullable=False),
96
+ )
97
+ engine = engine_tables(metadata, outbox=True, audit=True) # the engine's own tables
98
+
99
+ mapper_registry.map_imperatively(Task, tasks_table)
100
+ map_engine(mapper_registry, engine)
101
+
102
+ sessions = async_sessionmaker(create_async_engine("sqlite+aiosqlite:///tasks.db"))
103
+ manager = ResourceManager(
104
+ registry,
105
+ unit_of_work_factory(sessions, registry, outbox_table=engine.outbox),
106
+ )
107
+ ```
108
+
109
+ ## Documentation
110
+
111
+ - [Documentation site](https://eloisans.github.io/python-resource-engine/),
112
+ with the [API reference](https://eloisans.github.io/python-resource-engine/api/index.html).
113
+ - [Migrations](https://eloisans.github.io/python-resource-engine/migrations.html)
114
+ and [messaging](https://eloisans.github.io/python-resource-engine/messaging.html)
115
+ (outbox, relay, inbox).
116
+ - The [invoices example](https://eloisans.github.io/python-resource-engine/example-app.html)
117
+ wires every table.
118
+ - [Changelog](https://github.com/EloiSans/python-resource-engine/blob/main/packages/resource-engine-sqlalchemy/CHANGELOG.md).
119
+
120
+ Requires Python 3.12 or later. Licensed under Apache 2.0.
@@ -0,0 +1,91 @@
1
+ # resource-engine-sqlalchemy
2
+
3
+ [![PyPI](https://img.shields.io/pypi/v/resource-engine-sqlalchemy)](https://pypi.org/project/resource-engine-sqlalchemy/)
4
+ [![Python](https://img.shields.io/pypi/pyversions/resource-engine-sqlalchemy)](https://pypi.org/project/resource-engine-sqlalchemy/)
5
+ [![Docs](https://img.shields.io/badge/docs-site-blue)](https://eloisans.github.io/python-resource-engine/)
6
+
7
+ SQL storage for [Resource Engine](https://pypi.org/project/resource-engine/),
8
+ a framework for business backends you declare instead of writing CRUD,
9
+ permissions, transactions and state transitions for every entity.
10
+
11
+ This adapter stores the resources' records with SQLAlchemy 2 (async), and
12
+ gives the engine the tables it needs around them, in the same transaction as
13
+ each change:
14
+
15
+ - **A generic repository for every resource:** filters, sorting, search,
16
+ pages, `expand` of related records, and permission conditions translated to
17
+ SQL, so a list returns only the rows the caller may see.
18
+ - **A unit of work** that wraps each operation in one transaction.
19
+ - **The transactional outbox and the consumer inbox:** events are stored with
20
+ the change that raised them, and a message is handled once.
21
+ - **Engine tables** for the audit trail (with optional hash seals),
22
+ permission policies, API keys, documents, idempotency keys, job leases and
23
+ the worker's activity, created only when you ask for them.
24
+ - **Alembic support** (`[alembic]`): autogenerate sees the engine's tables
25
+ next to yours, with checks for migrations that would fail on tables that
26
+ hold data.
27
+
28
+ Domain classes stay plain: you map them with SQLAlchemy's imperative mapping
29
+ in the infrastructure layer, so the domain never imports SQLAlchemy. Tested
30
+ on SQLite and PostgreSQL.
31
+
32
+ ## Install
33
+
34
+ ```bash
35
+ pip install resource-engine-sqlalchemy
36
+ pip install "resource-engine-sqlalchemy[alembic]" # with migrations
37
+ ```
38
+
39
+ Add the async driver for your database, such as `aiosqlite` or `asyncpg`.
40
+
41
+ ## Use
42
+
43
+ ```python
44
+ from resource_engine import ResourceManager
45
+ from resource_engine_sqlalchemy import (
46
+ NAMING_CONVENTION,
47
+ engine_tables,
48
+ map_engine,
49
+ unit_of_work_factory,
50
+ )
51
+ from sqlalchemy import Column, Integer, MetaData, String, Table
52
+ from sqlalchemy.ext.asyncio import async_sessionmaker, create_async_engine
53
+ from sqlalchemy.orm import registry as orm_registry
54
+
55
+ from tasks.domain import Task # a plain dataclass
56
+ from tasks.resources import registry # a ResourceRegistry with TaskResource
57
+
58
+ metadata = MetaData(naming_convention=NAMING_CONVENTION)
59
+ mapper_registry = orm_registry(metadata=metadata)
60
+
61
+ tasks_table = Table(
62
+ "tasks",
63
+ metadata,
64
+ Column("id", Integer, primary_key=True, autoincrement=True),
65
+ Column("title", String(200), nullable=False),
66
+ Column("status", String(32), nullable=False),
67
+ )
68
+ engine = engine_tables(metadata, outbox=True, audit=True) # the engine's own tables
69
+
70
+ mapper_registry.map_imperatively(Task, tasks_table)
71
+ map_engine(mapper_registry, engine)
72
+
73
+ sessions = async_sessionmaker(create_async_engine("sqlite+aiosqlite:///tasks.db"))
74
+ manager = ResourceManager(
75
+ registry,
76
+ unit_of_work_factory(sessions, registry, outbox_table=engine.outbox),
77
+ )
78
+ ```
79
+
80
+ ## Documentation
81
+
82
+ - [Documentation site](https://eloisans.github.io/python-resource-engine/),
83
+ with the [API reference](https://eloisans.github.io/python-resource-engine/api/index.html).
84
+ - [Migrations](https://eloisans.github.io/python-resource-engine/migrations.html)
85
+ and [messaging](https://eloisans.github.io/python-resource-engine/messaging.html)
86
+ (outbox, relay, inbox).
87
+ - The [invoices example](https://eloisans.github.io/python-resource-engine/example-app.html)
88
+ wires every table.
89
+ - [Changelog](https://github.com/EloiSans/python-resource-engine/blob/main/packages/resource-engine-sqlalchemy/CHANGELOG.md).
90
+
91
+ Requires Python 3.12 or later. Licensed under Apache 2.0.
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "resource-engine-sqlalchemy"
3
- version = "0.1.0"
3
+ version = "0.1.1"
4
4
  description = "SQLAlchemy persistence adapter (repositories and unit of work) for Resource Engine."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.12"
@@ -25,7 +25,7 @@ alembic = ["alembic>=1.13", "alembic-postgresql-enum>=1.8"]
25
25
 
26
26
  [project.urls]
27
27
  Homepage = "https://github.com/EloiSans/python-resource-engine"
28
- Documentation = "https://github.com/EloiSans/python-resource-engine/tree/main/docs"
28
+ Documentation = "https://eloisans.github.io/python-resource-engine/"
29
29
  Source = "https://github.com/EloiSans/python-resource-engine/tree/main/packages/resource-engine-sqlalchemy"
30
30
  Issues = "https://github.com/EloiSans/python-resource-engine/issues"
31
31
  Changelog = "https://github.com/EloiSans/python-resource-engine/blob/main/packages/resource-engine-sqlalchemy/CHANGELOG.md"
@@ -1,34 +0,0 @@
1
- Metadata-Version: 2.5
2
- Name: resource-engine-sqlalchemy
3
- Version: 0.1.0
4
- Summary: SQLAlchemy persistence adapter (repositories and unit of work) for Resource Engine.
5
- Project-URL: Homepage, https://github.com/EloiSans/python-resource-engine
6
- Project-URL: Documentation, https://github.com/EloiSans/python-resource-engine/tree/main/docs
7
- Project-URL: Source, https://github.com/EloiSans/python-resource-engine/tree/main/packages/resource-engine-sqlalchemy
8
- Project-URL: Issues, https://github.com/EloiSans/python-resource-engine/issues
9
- Project-URL: Changelog, https://github.com/EloiSans/python-resource-engine/blob/main/packages/resource-engine-sqlalchemy/CHANGELOG.md
10
- License-Expression: Apache-2.0
11
- License-File: LICENSE
12
- Classifier: Development Status :: 3 - Alpha
13
- Classifier: Framework :: AsyncIO
14
- Classifier: Intended Audience :: Developers
15
- Classifier: Operating System :: OS Independent
16
- Classifier: Programming Language :: Python :: 3
17
- Classifier: Programming Language :: Python :: 3.12
18
- Classifier: Programming Language :: Python :: 3.13
19
- Classifier: Programming Language :: Python :: 3.14
20
- Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
21
- Classifier: Typing :: Typed
22
- Requires-Python: >=3.12
23
- Requires-Dist: resource-engine<0.2,>=0.1.0
24
- Requires-Dist: sqlalchemy[asyncio]>=2.0
25
- Provides-Extra: alembic
26
- Requires-Dist: alembic-postgresql-enum>=1.8; extra == 'alembic'
27
- Requires-Dist: alembic>=1.13; extra == 'alembic'
28
- Description-Content-Type: text/markdown
29
-
30
- # resource-engine-sqlalchemy
31
-
32
- SQLAlchemy 2 async adapter for Resource Engine: generic repository, unit of work, transactional outbox and consumer inbox for imperatively mapped domain entities.
33
-
34
- Part of [Resource Engine](../../README.md).
@@ -1,5 +0,0 @@
1
- # resource-engine-sqlalchemy
2
-
3
- SQLAlchemy 2 async adapter for Resource Engine: generic repository, unit of work, transactional outbox and consumer inbox for imperatively mapped domain entities.
4
-
5
- Part of [Resource Engine](../../README.md).