Skip to main content

Add your description here

Project description

Fassung

Fassung combines asyncpg, pydantic and the template strings to provide an ergonomic, type- and SQL-injection-safe interface for working with PostgreSQL databases.

It is currently just a proof of concept and not ready for production use.

Installation

Fassung requires python 3.14. You can install it with

pip install fassung

or

uv add fassung

Usage

Fassung is very similar to asyncpg. The central class is the Pool class, which is a context manager for a connection pool. You can use the Pool class as a context manager to create connections. Each connection can execute queries.

from fassung import Pool
from pydantic import BaseModel


class Student(BaseModel):
    id: int
    name: str
    age: int


async def main():
    pool = Pool()
    async with pool.acquire() as connection:
        async with connection as transaction:
            age = 18
            students: list[Student] = await transaction.fetch(
                Student, t"SELECT * FROM students WHERE age = {age}"
            )
            for student in students:
                print(student.name)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fassung-0.1.0.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fassung-0.1.0-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file fassung-0.1.0.tar.gz.

File metadata

  • Download URL: fassung-0.1.0.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fassung-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a59debcfbba0a0c1eb836b4b8be8bcee7e2aa307a5efaf6e3809946d1364a38c
MD5 1a59555e6ab21490728fc35d71b85945
BLAKE2b-256 07e5007f3f6f6f4a9a9ff793840228d92c40b37234d01881875ed6e3cc4bc2ec

See more details on using hashes here.

Provenance

The following attestation bundles were made for fassung-0.1.0.tar.gz:

Publisher: ci.yml on smorokin/fassung

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fassung-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: fassung-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fassung-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 14b5bed84d1a4826dc33e92f09810231113d616a1d54513f3415e56b91da55d3
MD5 02fa269db27724b08a1d7c73412b5e87
BLAKE2b-256 08cf37c37676ec84d9a50c850a6305d2ec3953b9dc3cfc5dd60680417d1ea65c

See more details on using hashes here.

Provenance

The following attestation bundles were made for fassung-0.1.0-py3-none-any.whl:

Publisher: ci.yml on smorokin/fassung

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page