Skip to main content

patera-database

Async SQLAlchemy integration for Patera: databases, request sessions, repositories and transactions. Part of Patera, a modular async-first Python web framework.

Installation

pip install patera-database
# or, with uv
uv add "patera[database]"

Requires Python 3.13 or newer and patera>=0.121.

Usage

patera-database integrates async SQLAlchemy. Install a driver for your database too (aiosqlite is included; e.g. asyncpg for PostgreSQL).

# app/database.py
from sqlalchemy import Integer, String
from sqlalchemy.orm import Mapped, mapped_column

from patera.database.sql import DeclarativeBaseModel, SqlDatabase, SqlDatabaseManager


class MainDb(SqlDatabase):
    __db_name__ = "main"


class Databases(SqlDatabaseManager):
    databases = [MainDb]


class Base(DeclarativeBaseModel):
    __abstract__ = True
    __db_name__ = "main"          # models are bound to a database by name


class Note(Base):
    __tablename__ = "notes"

    id: Mapped[int] = mapped_column(Integer, primary_key=True)
    title: Mapped[str] = mapped_column(String(200))

See the SQL databases section of the Patera documentation for the full guide.

License

MIT. See LICENSE.

Metadata

Release files for patera-database 0.13.5

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

Source distribution (sdist)

Source distribution for patera-database 0.13.5
File Size Uploaded Provenance Actions
patera_database-0.13.5.tar.gz 18.7 kB Without provenance Details for patera_database-0.13.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for patera-database 0.13.5
File Interpreter ABI Platform Actions
patera_database-0.13.5-py3-none-any.whl Python 3 none any Details for patera_database-0.13.5-py3-none-any.whl

Total release size: 42.0 kB

Release files / patera_database-0.13.5.tar.gz

Download URL patera_database-0.13.5.tar.gz
Size 18.7 kB
Tags Source
SHA-256 checksum
How to use checksums
0ae3f90c8aa703f4dbcfc41648cf32703761182ab62b9b0f2a67a8b8f2751e13
BLAKE2b-256 checksum
How to use checksums
23afeb76a70f296668895cec102bc7997cad74eae2b4c37a3c977f92efc857ad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / patera_database-0.13.5-py3-none-any.whl

Download URL patera_database-0.13.5-py3-none-any.whl
Size 23.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8624c23d2015f4cf80a4f8d6d991c3b18a35f37c92a936f6fb8e3c62c1c14469
BLAKE2b-256 checksum
How to use checksums
6f3ce8b8226c9db4b71f216cc073cb2180a6d96e13acaabdea61a33d993832c3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for patera-database 0.13.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.13.5 This release

2 release files No provenance

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