VintaSend SQLAlchemy
SQLAlchemy backend implementation for VintaSend.
Provides a synchronous (SQLAlchemyNotificationBackend) and an AsyncIO
(SQLAlchemyAsyncIONotificationBackend) notification backend, plus a filesystem-backed
attachment manager.
Compatibility
- Python 3.10 - 3.14
- SQLAlchemy 2.0+
- vintasend 2.0+
This release implements the full vintasend 2.0 backend contract: one-off notifications, the
composable filtering / ordering API (filter_notifications), sent_at / read_at, the tenant
partition key, git_commit_sha, bulk read, and the attachment manager seam.
It also persists vintasend's template-version fields: requested_template_version (which version
of its template a notification renders) and used_template_version (which version the renderer
reported it actually used, written through store_template_version at send time). Both are
filterable -- {"requested_template_version": 3}, {"used_template_version": [1, 2]} -- as
integer membership, with the same NULL semantics as every other field: a notification with no
version never matches positively and is included under negation. See
Template Version Pinning.
Backends
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from vintasend.services.notification_service import NotificationService
from vintasend_sqlalchemy.services.notification_backends.sqlalchemy_notification_backend import (
SQLAlchemyNotificationBackend,
)
from myapp.models import Notification # your GenericNotification subclass
engine = create_engine("postgresql://...")
Session = sessionmaker(bind=engine)
backend = SQLAlchemyNotificationBackend(Session, Notification)
service = NotificationService(notification_backend=backend, notification_adapters=[...])
The AsyncIO backend takes an async_sessionmaker instead:
from sqlalchemy.ext.asyncio import create_async_engine, async_sessionmaker
from vintasend_sqlalchemy.services.notification_backends.sqlalchemy_notification_backend import (
SQLAlchemyAsyncIONotificationBackend,
)
engine = create_async_engine("postgresql+asyncpg://...")
Session = async_sessionmaker(bind=engine)
backend = SQLAlchemyAsyncIONotificationBackend(Session, Notification)
Attachments
Each backend defaults to a FilesystemAttachmentManager (async: FilesystemAsyncIOAttachmentManager)
that stores uploaded files under a base directory (VINTASEND_ATTACHMENTS_PATH, default
vintasend_attachments/). Configure a different manager on the service to store bytes elsewhere;
the backend only persists the attachment_file_records / notification_attachments rows.
Migrations
The package ships Alembic helper ops so your migrations stay in sync with the models:
create_notification_table(user_id_type)- the basenotificationstable.upgrade_notification_table_to_2_0()- adds the 2.0 columns (one-off recipient fields,sent_at,read_at,tenant,git_commit_sha) and relaxesuser_idto nullable.upgrade_notification_table_to_2_1()- adds the 2.1 template-version columns (requested_template_version,used_template_version). Both nullable, no backfill: a notification written before them was rendered against whatever its template said at the time, and there is no honest value to invent for it.create_attachment_tables()- theattachment_file_recordsandnotification_attachmentstables backing the attachment seam.
Each has a matching downgrade_notification_table_from_* / drop_attachment_tables.
See migrations/versions/ for the reference migrations used by the test suite.
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 vintasend_sqlalchemy-3.0.0.tar.gz.
File metadata
- Download URL: vintasend_sqlalchemy-3.0.0.tar.gz
- Upload date:
- Size: 30.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d0feb9a15a02da2e0e0e84a32e7128e13b9d995ca26c165aef04e99519bfcbc0
|
|
| MD5 |
3672a12b07d71deb04bfb492e096f35e
|
|
| BLAKE2b-256 |
b055152a8706a84aec9420c44730d37206baca17a0a1e54cd88fd7cf62717473
|
Provenance
The following attestation bundles were made for vintasend_sqlalchemy-3.0.0.tar.gz:
Publisher:
publish.yml on vintasoftware/vintasend-sqlalchemy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vintasend_sqlalchemy-3.0.0.tar.gz -
Subject digest:
d0feb9a15a02da2e0e0e84a32e7128e13b9d995ca26c165aef04e99519bfcbc0 - Sigstore transparency entry: 2554483195
- Sigstore integration time:
-
Permalink:
vintasoftware/vintasend-sqlalchemy@83be670718c65111922ac8da9cd9ce96fe2be331 -
Branch / Tag:
refs/tags/v3.0.0 - Owner: https://github.com/vintasoftware
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@83be670718c65111922ac8da9cd9ce96fe2be331 -
Trigger Event:
push
-
Statement type:
File details
Details for the file vintasend_sqlalchemy-3.0.0-py3-none-any.whl.
File metadata
- Download URL: vintasend_sqlalchemy-3.0.0-py3-none-any.whl
- Upload date:
- Size: 36.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fcb373861bd9e2243fa7d8621254394cc065b22b018b01942ea13e52ded0fa7d
|
|
| MD5 |
5b28b91092b64e7274938f8ffad5395f
|
|
| BLAKE2b-256 |
6f0fed5df02982b672cc4a2a026bd477e370a33a95d07a38fd552e1b4f7cfe9b
|
Provenance
The following attestation bundles were made for vintasend_sqlalchemy-3.0.0-py3-none-any.whl:
Publisher:
publish.yml on vintasoftware/vintasend-sqlalchemy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vintasend_sqlalchemy-3.0.0-py3-none-any.whl -
Subject digest:
fcb373861bd9e2243fa7d8621254394cc065b22b018b01942ea13e52ded0fa7d - Sigstore transparency entry: 2554483269
- Sigstore integration time:
-
Permalink:
vintasoftware/vintasend-sqlalchemy@83be670718c65111922ac8da9cd9ce96fe2be331 -
Branch / Tag:
refs/tags/v3.0.0 - Owner: https://github.com/vintasoftware
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@83be670718c65111922ac8da9cd9ce96fe2be331 -
Trigger Event:
push
-
Statement type: