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.58.0'
# pip install 'etlantic==0.58.0'

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. Optional adapter roles should register their shared lifecycle with backend.register_runtime_role(role); PrefectDispatcher registers automatically. This keeps backend shutdown from disposing shared stores during an adapter tick. 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.58.0

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.58.0
File Size Uploaded
etlantic_sqlmodel-0.58.0.tar.gz 60.1 kB Details

Built distribution (wheel)

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

Total release size: 138.8 kB

Release files / etlantic_sqlmodel-0.58.0.tar.gz

Download URL etlantic_sqlmodel-0.58.0.tar.gz
Size 60.1 kB
Tags Source
SHA-256 checksum
How to use checksums
7fce72407f51dafab97ae161219935025cabe629b9e173afa98bfa1288097c34
BLAKE2b-256 checksum
How to use checksums
7767eeeab91a8864909588809e51d973afb79b1e0f9c683d90b0af5f7e1ae6d1
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.58.0-py3-none-any.whl

Download URL etlantic_sqlmodel-0.58.0-py3-none-any.whl
Size 78.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d1d3e0caa4ed7d5b24e364bcfea921021f166fe177b4bfacd2be1be9946a6d91
BLAKE2b-256 checksum
How to use checksums
2603dac26c46dc665bc64ddad2855d6fe9a14c947efb0b33c0993a9c2dd59998
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

This release

0.58.0 This release

2 release files

0.57.2

2 release files

0.57.1

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