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.
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.create_attachment_tables()- theattachment_file_recordsandnotification_attachmentstables backing the attachment seam.
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-2.0.0.tar.gz.
File metadata
- Download URL: vintasend_sqlalchemy-2.0.0.tar.gz
- Upload date:
- Size: 27.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
poetry/2.0.0 CPython/3.12.2 Darwin/25.5.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fb9bc35bba7daec580b7b0a68462e7f185642a266106cc8e8f01864dd148bdb4
|
|
| MD5 |
4dc7ef022cf4ee9fcadd86276d25d905
|
|
| BLAKE2b-256 |
520fbba03404bf502e84c5537f4706692d7036eaa63c7e59ee3e53dcffe414aa
|
File details
Details for the file vintasend_sqlalchemy-2.0.0-py3-none-any.whl.
File metadata
- Download URL: vintasend_sqlalchemy-2.0.0-py3-none-any.whl
- Upload date:
- Size: 33.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
poetry/2.0.0 CPython/3.12.2 Darwin/25.5.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0c86aa44aef829c8999818e0bdb693960aec430405072ade3f2d10759b03de4a
|
|
| MD5 |
7589daf00f0af632b9eed0619d5edd9a
|
|
| BLAKE2b-256 |
8109ad894355c7397649c7e5742569806c97a118674aac3d277caa1335411dd7
|