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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a59debcfbba0a0c1eb836b4b8be8bcee7e2aa307a5efaf6e3809946d1364a38c
|
|
| MD5 |
1a59555e6ab21490728fc35d71b85945
|
|
| BLAKE2b-256 |
07e5007f3f6f6f4a9a9ff793840228d92c40b37234d01881875ed6e3cc4bc2ec
|
Provenance
The following attestation bundles were made for fassung-0.1.0.tar.gz:
Publisher:
ci.yml on smorokin/fassung
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fassung-0.1.0.tar.gz -
Subject digest:
a59debcfbba0a0c1eb836b4b8be8bcee7e2aa307a5efaf6e3809946d1364a38c - Sigstore transparency entry: 945514766
- Sigstore integration time:
-
Permalink:
smorokin/fassung@81802d6c89a968a0522adfad212ae2681f36aad6 -
Branch / Tag:
refs/tags/v0.1.0b - Owner: https://github.com/smorokin
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@81802d6c89a968a0522adfad212ae2681f36aad6 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
14b5bed84d1a4826dc33e92f09810231113d616a1d54513f3415e56b91da55d3
|
|
| MD5 |
02fa269db27724b08a1d7c73412b5e87
|
|
| BLAKE2b-256 |
08cf37c37676ec84d9a50c850a6305d2ec3953b9dc3cfc5dd60680417d1ea65c
|
Provenance
The following attestation bundles were made for fassung-0.1.0-py3-none-any.whl:
Publisher:
ci.yml on smorokin/fassung
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fassung-0.1.0-py3-none-any.whl -
Subject digest:
14b5bed84d1a4826dc33e92f09810231113d616a1d54513f3415e56b91da55d3 - Sigstore transparency entry: 945514801
- Sigstore integration time:
-
Permalink:
smorokin/fassung@81802d6c89a968a0522adfad212ae2681f36aad6 -
Branch / Tag:
refs/tags/v0.1.0b - Owner: https://github.com/smorokin
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@81802d6c89a968a0522adfad212ae2681f36aad6 -
Trigger Event:
push
-
Statement type: