xtr-orm 5.1.0__tar.gz → 5.2.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.
- {xtr_orm-5.1.0 → xtr_orm-5.2.1}/PKG-INFO +10 -5
- {xtr_orm-5.1.0 → xtr_orm-5.2.1}/README.md +9 -4
- {xtr_orm-5.1.0 → xtr_orm-5.2.1}/pyproject.toml +1 -1
- {xtr_orm-5.1.0 → xtr_orm-5.2.1}/pyproject.toml.orig +1 -1
- xtr_orm-5.2.1/src/xtr_orm/recipe/manifest.toml +66 -0
- xtr_orm-5.1.0/src/xtr_orm/recipe/manifest.toml +0 -32
- {xtr_orm-5.1.0 → xtr_orm-5.2.1}/LICENSE +0 -0
- {xtr_orm-5.1.0 → xtr_orm-5.2.1}/src/xtr_orm/.agents/skills/xtr-orm/SKILL.md +0 -0
- {xtr_orm-5.1.0 → xtr_orm-5.2.1}/src/xtr_orm/.agents/skills/xtr-orm/references/commands.md +0 -0
- {xtr_orm-5.1.0 → xtr_orm-5.2.1}/src/xtr_orm/.agents/skills/xtr-orm/references/connections.md +0 -0
- {xtr_orm-5.1.0 → xtr_orm-5.2.1}/src/xtr_orm/.agents/skills/xtr-orm/references/messenger.md +0 -0
- {xtr_orm-5.1.0 → xtr_orm-5.2.1}/src/xtr_orm/.agents/skills/xtr-orm/references/migrations.md +0 -0
- {xtr_orm-5.1.0 → xtr_orm-5.2.1}/src/xtr_orm/__init__.py +0 -0
- {xtr_orm-5.1.0 → xtr_orm-5.2.1}/src/xtr_orm/bundle/__init__.py +0 -0
- {xtr_orm-5.1.0 → xtr_orm-5.2.1}/src/xtr_orm/bundle/connection_config.py +0 -0
- {xtr_orm-5.1.0 → xtr_orm-5.2.1}/src/xtr_orm/bundle/orm_bundle.py +0 -0
- {xtr_orm-5.1.0 → xtr_orm-5.2.1}/src/xtr_orm/bundle/orm_config.py +0 -0
- {xtr_orm-5.1.0 → xtr_orm-5.2.1}/src/xtr_orm/bundle/orm_mappings_pass.py +0 -0
- {xtr_orm-5.1.0 → xtr_orm-5.2.1}/src/xtr_orm/command/__init__.py +0 -0
- {xtr_orm-5.1.0 → xtr_orm-5.2.1}/src/xtr_orm/command/_reporting.py +0 -0
- {xtr_orm-5.1.0 → xtr_orm-5.2.1}/src/xtr_orm/command/connection_command.py +0 -0
- {xtr_orm-5.1.0 → xtr_orm-5.2.1}/src/xtr_orm/command/database_create_command.py +0 -0
- {xtr_orm-5.1.0 → xtr_orm-5.2.1}/src/xtr_orm/command/database_drop_command.py +0 -0
- {xtr_orm-5.1.0 → xtr_orm-5.2.1}/src/xtr_orm/command/migrations_current_command.py +0 -0
- {xtr_orm-5.1.0 → xtr_orm-5.2.1}/src/xtr_orm/command/migrations_diff_command.py +0 -0
- {xtr_orm-5.1.0 → xtr_orm-5.2.1}/src/xtr_orm/command/migrations_dump_schema_command.py +0 -0
- {xtr_orm-5.1.0 → xtr_orm-5.2.1}/src/xtr_orm/command/migrations_execute_command.py +0 -0
- {xtr_orm-5.1.0 → xtr_orm-5.2.1}/src/xtr_orm/command/migrations_generate_command.py +0 -0
- {xtr_orm-5.1.0 → xtr_orm-5.2.1}/src/xtr_orm/command/migrations_latest_command.py +0 -0
- {xtr_orm-5.1.0 → xtr_orm-5.2.1}/src/xtr_orm/command/migrations_list_command.py +0 -0
- {xtr_orm-5.1.0 → xtr_orm-5.2.1}/src/xtr_orm/command/migrations_migrate_command.py +0 -0
- {xtr_orm-5.1.0 → xtr_orm-5.2.1}/src/xtr_orm/command/migrations_rollup_command.py +0 -0
- {xtr_orm-5.1.0 → xtr_orm-5.2.1}/src/xtr_orm/command/migrations_status_command.py +0 -0
- {xtr_orm-5.1.0 → xtr_orm-5.2.1}/src/xtr_orm/command/migrations_up_to_date_command.py +0 -0
- {xtr_orm-5.1.0 → xtr_orm-5.2.1}/src/xtr_orm/command/migrations_version_command.py +0 -0
- {xtr_orm-5.1.0 → xtr_orm-5.2.1}/src/xtr_orm/command/run_sql_command.py +0 -0
- {xtr_orm-5.1.0 → xtr_orm-5.2.1}/src/xtr_orm/connection_registry.py +0 -0
- {xtr_orm-5.1.0 → xtr_orm-5.2.1}/src/xtr_orm/database/__init__.py +0 -0
- {xtr_orm-5.1.0 → xtr_orm-5.2.1}/src/xtr_orm/database/database_manager.py +0 -0
- {xtr_orm-5.1.0 → xtr_orm-5.2.1}/src/xtr_orm/exception/__init__.py +0 -0
- {xtr_orm-5.1.0 → xtr_orm-5.2.1}/src/xtr_orm/exception/invalid_argument_error.py +0 -0
- {xtr_orm-5.1.0 → xtr_orm-5.2.1}/src/xtr_orm/exception/migration_error.py +0 -0
- {xtr_orm-5.1.0 → xtr_orm-5.2.1}/src/xtr_orm/exception/missing_database_error.py +0 -0
- {xtr_orm-5.1.0 → xtr_orm-5.2.1}/src/xtr_orm/exception/orm_error.py +0 -0
- {xtr_orm-5.1.0 → xtr_orm-5.2.1}/src/xtr_orm/exception/session_unavailable_error.py +0 -0
- {xtr_orm-5.1.0 → xtr_orm-5.2.1}/src/xtr_orm/exception/unknown_connection_error.py +0 -0
- {xtr_orm-5.1.0 → xtr_orm-5.2.1}/src/xtr_orm/exception/unsupported_database_error.py +0 -0
- {xtr_orm-5.1.0 → xtr_orm-5.2.1}/src/xtr_orm/mapping_driver_interface.py +0 -0
- {xtr_orm-5.1.0 → xtr_orm-5.2.1}/src/xtr_orm/messenger/__init__.py +0 -0
- {xtr_orm-5.1.0 → xtr_orm-5.2.1}/src/xtr_orm/messenger/close_connection_middleware.py +0 -0
- {xtr_orm-5.1.0 → xtr_orm-5.2.1}/src/xtr_orm/messenger/open_transaction_logger_middleware.py +0 -0
- {xtr_orm-5.1.0 → xtr_orm-5.2.1}/src/xtr_orm/messenger/transaction_middleware.py +0 -0
- {xtr_orm-5.1.0 → xtr_orm-5.2.1}/src/xtr_orm/migrations/__init__.py +0 -0
- {xtr_orm-5.1.0 → xtr_orm-5.2.1}/src/xtr_orm/migrations/_environment.py +0 -0
- {xtr_orm-5.1.0 → xtr_orm-5.2.1}/src/xtr_orm/migrations/_history.py +0 -0
- {xtr_orm-5.1.0 → xtr_orm-5.2.1}/src/xtr_orm/migrations/_revisions.py +0 -0
- {xtr_orm-5.1.0 → xtr_orm-5.2.1}/src/xtr_orm/migrations/_schema.py +0 -0
- {xtr_orm-5.1.0 → xtr_orm-5.2.1}/src/xtr_orm/migrations/available_migration.py +0 -0
- {xtr_orm-5.1.0 → xtr_orm-5.2.1}/src/xtr_orm/migrations/direction.py +0 -0
- {xtr_orm-5.1.0 → xtr_orm-5.2.1}/src/xtr_orm/migrations/executed_migration.py +0 -0
- {xtr_orm-5.1.0 → xtr_orm-5.2.1}/src/xtr_orm/migrations/execution_result.py +0 -0
- {xtr_orm-5.1.0 → xtr_orm-5.2.1}/src/xtr_orm/migrations/migration_plan.py +0 -0
- {xtr_orm-5.1.0 → xtr_orm-5.2.1}/src/xtr_orm/migrations/migration_status.py +0 -0
- {xtr_orm-5.1.0 → xtr_orm-5.2.1}/src/xtr_orm/migrations/migrations_config.py +0 -0
- {xtr_orm-5.1.0 → xtr_orm-5.2.1}/src/xtr_orm/migrations/migrator.py +0 -0
- {xtr_orm-5.1.0 → xtr_orm-5.2.1}/src/xtr_orm/migrations/template/script.py.mako +0 -0
- {xtr_orm-5.1.0 → xtr_orm-5.2.1}/src/xtr_orm/py.typed +0 -0
- {xtr_orm-5.1.0 → xtr_orm-5.2.1}/src/xtr_orm/recipe/__init__.py +0 -0
- {xtr_orm-5.1.0 → xtr_orm-5.2.1}/src/xtr_orm/recipe/files/config/orm.py.tmpl +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: xtr-orm
|
|
3
|
-
Version: 5.1
|
|
3
|
+
Version: 5.2.1
|
|
4
4
|
Summary: Databases for async applications: engines, sessions and versioned schema migrations, configured once per connection.
|
|
5
5
|
Keywords: orm,database,migrations,sqlalchemy,alembic,asyncio
|
|
6
6
|
Author: Xterr
|
|
@@ -204,8 +204,9 @@ removing it undoes.
|
|
|
204
204
|
the [message bus middleware](#message-bus-middleware).
|
|
205
205
|
- **Recipe** — `uv run xtr-recipes recipes:sync` does the *Activate*, *Configure* and
|
|
206
206
|
*Environment* steps below: it lists `OrmBundle`, writes a starting `<app>/config/packages/orm.py` with the
|
|
207
|
-
`default` connection, and `DATABASE_URL` in `.env
|
|
208
|
-
|
|
207
|
+
`default` connection, and `DATABASE_URL` in `.env`, and adds a PostgreSQL `database` service to
|
|
208
|
+
`compose.yaml`, published on `5432` in `compose.override.yaml`. It prints the middleware step,
|
|
209
|
+
which a recipe cannot make for you.
|
|
209
210
|
- **Activate** — `OrmBundle: {"all": True}` in `BUNDLES` in `<app>/config/bundles.py`, imported from
|
|
210
211
|
`xtr_orm.bundle`.
|
|
211
212
|
- **Brings along** — the logging and console bundles, when those packages are installed.
|
|
@@ -218,10 +219,14 @@ removing it undoes.
|
|
|
218
219
|
[Kernel / bundle](#kernel--bundle).
|
|
219
220
|
- **Environment** — `DATABASE_URL`, read when a connection is first used — engine, session,
|
|
220
221
|
migrator or command — not when the application boots. Its query may carry options; see
|
|
221
|
-
[Options in the URL](#options-in-the-url).
|
|
222
|
+
[Options in the URL](#options-in-the-url). The recipe's value reaches the `database` service
|
|
223
|
+
`docker compose up -d database` starts; the `POSTGRES_*` variables that service reads, set in
|
|
224
|
+
the shell or `.env`, change its version, database, user and password — keep `DATABASE_URL` in
|
|
225
|
+
step with them.
|
|
222
226
|
- **Ignore** — nothing: commit `migrations/`.
|
|
223
227
|
- **Remove** — take the `orm_*` entries out of every bus's `middleware`, drop the `BUNDLES`
|
|
224
|
-
entry, delete `<app>/config/packages/orm.py
|
|
228
|
+
entry, delete `<app>/config/packages/orm.py` and the `xtr-orm` blocks in `compose.yaml` and
|
|
229
|
+
`compose.override.yaml`, then `uv remove xtr-orm`.
|
|
225
230
|
- **Check** — `debug:bundles` shows `orm` as `listed` and `active`, and
|
|
226
231
|
`orm:migrations:status` reaches the database.
|
|
227
232
|
|
|
@@ -172,8 +172,9 @@ removing it undoes.
|
|
|
172
172
|
the [message bus middleware](#message-bus-middleware).
|
|
173
173
|
- **Recipe** — `uv run xtr-recipes recipes:sync` does the *Activate*, *Configure* and
|
|
174
174
|
*Environment* steps below: it lists `OrmBundle`, writes a starting `<app>/config/packages/orm.py` with the
|
|
175
|
-
`default` connection, and `DATABASE_URL` in `.env
|
|
176
|
-
|
|
175
|
+
`default` connection, and `DATABASE_URL` in `.env`, and adds a PostgreSQL `database` service to
|
|
176
|
+
`compose.yaml`, published on `5432` in `compose.override.yaml`. It prints the middleware step,
|
|
177
|
+
which a recipe cannot make for you.
|
|
177
178
|
- **Activate** — `OrmBundle: {"all": True}` in `BUNDLES` in `<app>/config/bundles.py`, imported from
|
|
178
179
|
`xtr_orm.bundle`.
|
|
179
180
|
- **Brings along** — the logging and console bundles, when those packages are installed.
|
|
@@ -186,10 +187,14 @@ removing it undoes.
|
|
|
186
187
|
[Kernel / bundle](#kernel--bundle).
|
|
187
188
|
- **Environment** — `DATABASE_URL`, read when a connection is first used — engine, session,
|
|
188
189
|
migrator or command — not when the application boots. Its query may carry options; see
|
|
189
|
-
[Options in the URL](#options-in-the-url).
|
|
190
|
+
[Options in the URL](#options-in-the-url). The recipe's value reaches the `database` service
|
|
191
|
+
`docker compose up -d database` starts; the `POSTGRES_*` variables that service reads, set in
|
|
192
|
+
the shell or `.env`, change its version, database, user and password — keep `DATABASE_URL` in
|
|
193
|
+
step with them.
|
|
190
194
|
- **Ignore** — nothing: commit `migrations/`.
|
|
191
195
|
- **Remove** — take the `orm_*` entries out of every bus's `middleware`, drop the `BUNDLES`
|
|
192
|
-
entry, delete `<app>/config/packages/orm.py
|
|
196
|
+
entry, delete `<app>/config/packages/orm.py` and the `xtr-orm` blocks in `compose.yaml` and
|
|
197
|
+
`compose.override.yaml`, then `uv remove xtr-orm`.
|
|
193
198
|
- **Check** — `debug:bundles` shows `orm` as `listed` and `active`, and
|
|
194
199
|
`orm:migrations:status` reaches the database.
|
|
195
200
|
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# The recipe for xtr-orm: what *Use in an application* in the README takes, as
|
|
2
|
+
# data. Keep the two in step — the README is the source.
|
|
3
|
+
|
|
4
|
+
[bundles]
|
|
5
|
+
# "<module>:<class>" = the environments it is listed with, exactly as in BUNDLES.
|
|
6
|
+
"xtr_orm.bundle:OrmBundle" = { all = true }
|
|
7
|
+
|
|
8
|
+
[files]
|
|
9
|
+
# Destination under the application package = template under this recipe.
|
|
10
|
+
# The default connection on DATABASE_URL, written out so the application has
|
|
11
|
+
# one place to add replicas, connections and its models' metadata.
|
|
12
|
+
"config/packages/orm.py" = "files/config/orm.py.tmpl"
|
|
13
|
+
|
|
14
|
+
[env]
|
|
15
|
+
# Read when a connection is first used — engine, session, migrator or command —
|
|
16
|
+
# not when the application boots. The PostgreSQL compose.yaml runs, for the
|
|
17
|
+
# postgres extra the README installs; change it, or put the real one in
|
|
18
|
+
# .env.local.
|
|
19
|
+
DATABASE_URL = "postgresql+asyncpg://app:!ChangeMe!@127.0.0.1:5432/app"
|
|
20
|
+
|
|
21
|
+
[gitignore]
|
|
22
|
+
# Nothing: migrations/ is committed.
|
|
23
|
+
lines = []
|
|
24
|
+
|
|
25
|
+
# A PostgreSQL for DATABASE_URL to reach: `docker compose up -d database`.
|
|
26
|
+
# Kept verbatim: ${...} is Compose's own interpolation, read from the shell or .env.
|
|
27
|
+
[compose."compose.yaml"]
|
|
28
|
+
services = '''
|
|
29
|
+
database:
|
|
30
|
+
image: postgres:${POSTGRES_VERSION:-16}-alpine
|
|
31
|
+
environment:
|
|
32
|
+
POSTGRES_DB: ${POSTGRES_DB:-app}
|
|
33
|
+
# You should definitely change the password in production
|
|
34
|
+
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-!ChangeMe!}
|
|
35
|
+
POSTGRES_USER: ${POSTGRES_USER:-app}
|
|
36
|
+
healthcheck:
|
|
37
|
+
test: ["CMD", "pg_isready", "-d", "${POSTGRES_DB:-app}", "-U", "${POSTGRES_USER:-app}"]
|
|
38
|
+
timeout: 5s
|
|
39
|
+
retries: 5
|
|
40
|
+
start_period: 60s
|
|
41
|
+
volumes:
|
|
42
|
+
- database_data:/var/lib/postgresql/data:rw
|
|
43
|
+
# You may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data!
|
|
44
|
+
# - ./docker/db/data:/var/lib/postgresql/data:rw
|
|
45
|
+
'''
|
|
46
|
+
volumes = '''
|
|
47
|
+
database_data:
|
|
48
|
+
'''
|
|
49
|
+
|
|
50
|
+
# Development only: the database published on the port DATABASE_URL names.
|
|
51
|
+
[compose."compose.override.yaml"]
|
|
52
|
+
services = '''
|
|
53
|
+
database:
|
|
54
|
+
ports:
|
|
55
|
+
- "5432:5432"
|
|
56
|
+
'''
|
|
57
|
+
|
|
58
|
+
[notes]
|
|
59
|
+
steps = [
|
|
60
|
+
"With the messenger bundle active, list the orm_* middleware in every bus's middleware: every message is then a unit of work.",
|
|
61
|
+
]
|
|
62
|
+
check = [
|
|
63
|
+
"<script> debug:bundles — orm is listed and active",
|
|
64
|
+
"<script> orm:migrations:status — it reaches the database",
|
|
65
|
+
]
|
|
66
|
+
run = ["docker compose up -d database — the PostgreSQL DATABASE_URL points at"]
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
# The recipe for xtr-orm: what *Use in an application* in the README takes, as
|
|
2
|
-
# data. Keep the two in step — the README is the source.
|
|
3
|
-
|
|
4
|
-
[bundles]
|
|
5
|
-
# "<module>:<class>" = the environments it is listed with, exactly as in BUNDLES.
|
|
6
|
-
"xtr_orm.bundle:OrmBundle" = { all = true }
|
|
7
|
-
|
|
8
|
-
[files]
|
|
9
|
-
# Destination under the application package = template under this recipe.
|
|
10
|
-
# The default connection on DATABASE_URL, written out so the application has
|
|
11
|
-
# one place to add replicas, connections and its models' metadata.
|
|
12
|
-
"config/packages/orm.py" = "files/config/orm.py.tmpl"
|
|
13
|
-
|
|
14
|
-
[env]
|
|
15
|
-
# Read when a connection is first used — engine, session, migrator or command —
|
|
16
|
-
# not when the application boots. A local PostgreSQL to start from, for the
|
|
17
|
-
# postgres extra the README installs; change it, or put the real one in
|
|
18
|
-
# .env.local.
|
|
19
|
-
DATABASE_URL = "postgresql+asyncpg://app:change-me@127.0.0.1:5432/app"
|
|
20
|
-
|
|
21
|
-
[gitignore]
|
|
22
|
-
# Nothing: migrations/ is committed.
|
|
23
|
-
lines = []
|
|
24
|
-
|
|
25
|
-
[notes]
|
|
26
|
-
steps = [
|
|
27
|
-
"With the messenger bundle active, list the orm_* middleware in every bus's middleware: every message is then a unit of work.",
|
|
28
|
-
]
|
|
29
|
-
check = [
|
|
30
|
-
"<script> debug:bundles — orm is listed and active",
|
|
31
|
-
"<script> orm:migrations:status — it reaches the database",
|
|
32
|
-
]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{xtr_orm-5.1.0 → xtr_orm-5.2.1}/src/xtr_orm/.agents/skills/xtr-orm/references/connections.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|