Skip to main content

etlantic-sqlmodel

Optional bridge between ETLantic Data contracts and SQLModel table models, plus optional CP1 control-plane reference stores. Install when you need contract_to_sqlmodel helpers or SQLModel-backed definition/submission stores for local CP1 demos. Package version is 0.57.0 — pin with core.

Install

pip install 'etlantic-sqlmodel==0.57.1'
# pip install 'etlantic==0.57.1'

Schema bridge

from etlantic import Data
from etlantic_sqlmodel import contract_to_sqlmodel, compare_metadata


class Customer(Data):
    customer_id: int
    name: str


CustomerTable = contract_to_sqlmodel(
    Customer,
    table_name="customer",
    primary_key=("customer_id",),
)
assert compare_metadata(Customer, CustomerTable).valid

Control-plane reference stores (CP1/CP2)

Request-scoped sessions and SQLModel-backed DefinitionRepository / SubmissionStore / CP2 RegistryProvider implementations. Persistence models are separate from HTTP response models. create_control_plane_tables and create_registry_tables are for tests and local demos only — production must apply versioned migrations via etlantic_sqlmodel.migrations (do not use create_all as the sole schema path).

from etlantic_sqlmodel.control_plane import (
    SQLModelDefinitionRepository,
    SQLModelSubmissionStore,
    SqlModelRegistryProvider,
    create_sqlite_engine,
)
from etlantic_sqlmodel.migrations import apply_migrations

engine = create_sqlite_engine("sqlite:///cp.db")
apply_migrations(engine)  # all provider-owned CP1–CP4 tables
registry = SqlModelRegistryProvider(engine)
definitions = SQLModelDefinitionRepository(engine)
submissions = SQLModelSubmissionStore(engine)

Registry conformance (memory vs SQLModel promote/suspend):

uv run python scripts/check_registry_conformance.py --fake

These stores honor scoped idempotency and survive process restart when backed by a durable database URL. For CP-GA Supported profiles, treat snapshots as canonical for backup/restore; entity dual-write rows are denormalized mirrors for isolation queries. Use separate engines/schemas per tenant for isolated-deployment / dedicated-schema.

Managed backend and schema inspection (0.57.0)

create_managed_backend builds the authorized service graph without importing FastAPI or requiring an HTTP context factory. The factory owns an engine it creates; an injected engine remains caller-owned. Both paths require explicit migrations and perform read-only compatibility inspection before returning.

from etlantic_sqlmodel import SQLModelBackendConfig, create_managed_backend

backend = create_managed_backend(
    SQLModelBackendConfig(
        database_url=database_url,
        store_id="control-plane",
        profile=profile,
    ),
    authorizer=authorizer,
)

# The context must come from the consumer's trusted identity boundary.
schedule = backend.schedule_service
worker = backend.create_execution_host(owner_id="etl-worker-1")
action_worker = backend.create_action_execution_host(worker_id="actions-1")
scheduler = backend.create_scheduler(owner_id="scheduler-1")

Each role exposes status(), request_drain(), and a ready() convenience method. Run blocking ticks on consumer-owned threads. After requesting drain, join those threads before calling backend.close(); close refuses to dispose an owned engine while a role tick remains active. The schedule service owns command authorization and trigger recovery for both headless and HTTP callers.

schema_requirements() publishes required managed-store tables, columns, primary keys, and unique keys. inspect_schema(engine) returns one of fresh, behind, compatible, unknown_or_ahead, partial_or_corrupt, or unreachable, with redacted reason codes. It does not create or upgrade schema objects. Apply etlantic_sqlmodel.migrations.upgrade(engine) as an explicit deployment step.

Optional packages · Source · Issues

Metadata

Release files for etlantic-sqlmodel 0.57.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for etlantic-sqlmodel 0.57.1
File Size Uploaded
etlantic_sqlmodel-0.57.1.tar.gz 58.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for etlantic-sqlmodel 0.57.1
File Interpreter ABI Platform
etlantic_sqlmodel-0.57.1-py3-none-any.whl Python 3 none any Details

Total release size: 136.0 kB

Release files / etlantic_sqlmodel-0.57.1.tar.gz

Download URL etlantic_sqlmodel-0.57.1.tar.gz
Size 58.5 kB
Tags Source
SHA-256 checksum
How to use checksums
424fa1a7d8a1276410bbe464590f97b315f7e9a3e7e0ee58740a409223f98efe
BLAKE2b-256 checksum
How to use checksums
284fbd1a275439426fd7c55af3487c9280189412b9460f29084f9d5bfd28889b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.0 {"installer":{"name":"uv","version":"0.12.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / etlantic_sqlmodel-0.57.1-py3-none-any.whl

Download URL etlantic_sqlmodel-0.57.1-py3-none-any.whl
Size 77.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1fa799b7a95df81dd0f66cd0c31af085b10a70e2f2ffbfc144236b4110833b10
BLAKE2b-256 checksum
How to use checksums
abbe1eb002640a949a9679e92ea82fa8169f5b0f017b54e7416411fd8a22cdd1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.0 {"installer":{"name":"uv","version":"0.12.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

0.58.0

2 release files

0.57.2

2 release files

This release

0.57.1 This release

2 release files

0.55.0

2 release files

0.54.0

2 release files

0.53.0

2 release files

0.52.1

2 release files

0.52.0

2 release files

0.51.0

2 release files

0.50.1

2 release files

0.50.0

2 release files

0.48.0

2 release files

0.47.0

2 release files

0.46.0

2 release files

0.45.0

2 release files

0.40.0

2 release files

0.39.0

2 release files

0.38.0

2 release files

0.37.0

2 release files

0.36.0

2 release files

0.35.0

2 release files

0.34.0

2 release files

0.33.0

2 release files

0.32.0

2 release files

0.31.0

2 release files

0.30.0

2 release files

0.29.0

2 release files

0.27.0

2 release files

0.26.0

2 release files

0.25.0

2 release files

0.24.0

2 release files

0.23.0

2 release files

0.22.0

2 release files

0.21.0

2 release files

0.20.0

2 release files

0.19.0

2 release files

0.18.0

2 release files

0.14.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page