Skip to main content

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 base notifications table.
  • upgrade_notification_table_to_2_0() - adds the 2.0 columns (one-off recipient fields, sent_at, read_at, tenant, git_commit_sha) and relaxes user_id to 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() - the attachment_file_records and notification_attachments tables 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.

Metadata

Release files for vintasend-sqlalchemy 3.3.0

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

Source distribution (sdist)

Source distribution for vintasend-sqlalchemy 3.3.0
File Size Uploaded
vintasend_sqlalchemy-3.3.0.tar.gz 30.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for vintasend-sqlalchemy 3.3.0
File Interpreter ABI Platform
vintasend_sqlalchemy-3.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 66.8 kB

Release files / vintasend_sqlalchemy-3.3.0.tar.gz

Download URL vintasend_sqlalchemy-3.3.0.tar.gz
Size 30.6 kB
Tags Source
SHA-256 checksum
How to use checksums
c7cec6cdaa15c45345eaea3c30618594de5d55d64a757aa3e1ccf1a20159458b
BLAKE2b-256 checksum
How to use checksums
fc412018e48a6ac76b238d7bf39cb8186ef30f96e08a28b772b907ef0e5f756e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 9, 2026.

Transparency log

Release files / vintasend_sqlalchemy-3.3.0-py3-none-any.whl

Download URL vintasend_sqlalchemy-3.3.0-py3-none-any.whl
Size 36.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
16e5010e260c0fa526cbffbda75f1c6cbd26b699dac5966568cae7cec03eaf87
BLAKE2b-256 checksum
How to use checksums
392f2948bb8a40c32bbc37510b53a45d6e70024e40c596fac1ec5481d396d753
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 9, 2026.

Transparency log

Release history Release notifications | RSS feed

3.5.0

2 release files

3.4.0

2 release files

This release

3.3.0 This release

2 release files

3.2.0

2 release files

3.1.1

2 release files

3.1.0

2 release files

3.0.0

2 release files

2.0.0

2 release files

0.1.4

2 release files

0.1.2

2 release files

0.1.0

2 release files

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