sqlbag
various snippets of SQL-related boilerplate
What it is and what it does
sqlbag is a collection of convenience functions and helpers built on top of SQLAlchemy to reduce boilerplate when working with databases. It provides utilities for managing database connections, setting up Flask integration, working with the ORM, and creating temporary databases for integration tests. The package bundles these common patterns into a single import so you don't have to rewrite them across projects.
The package depends on six, sqlalchemy, packaging, and pathlib, and can be extended with optional database drivers (psycopg2 for PostgreSQL, pymysql for MySQL/MariaDB) via install-time bundles. However, it has been abandoned since its latest release on 2021-04-01 with no active maintenance, and carries Alpha status, meaning it may not work reliably with modern versions of its dependencies.
Use it for:
- Set up Flask applications with SQLAlchemy ORM without writing repetitive connection and session boilerplate.
- Create and tear down temporary test databases for integration tests that need a real database backend.
- Manage database connections across multiple projects using a shared set of helpers.
- Quickly prototype database-backed applications by reusing common ORM and connection patterns.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
sqlbag provides a collection of SQLAlchemy utilities and helpers for common database tasks, including connection management, Flask integration, ORM helpers, and temporary database setup for testing.
No—not recommended for new projects. The package is abandoned (no updates since 2021-04-01), carries Alpha status, and its license is unclear. While it has low install friction and no known vulnerabilities, the lack of maintenance means it will not keep pace with SQLAlchemy or Python version changes. For new work, prefer actively maintained alternatives or write the boilerplate directly.
Install
sqlbag on PyPI
pip
pip install sqlbaguv
uv add sqlbagpoetry
poetry add sqlbagInstalling sqlbag
Before you install
Installation is straightforward with low friction, but the package is abandoned as of 2021 with no updates since its latest release. The last commit was in March 2023, suggesting minimal maintenance. It carries Alpha status and may not be compatible with modern SQLAlchemy or Python versions.
License in practice
License treatment is unclear—no SPDX identifier or raw license text is available. Before using this package in production or distribution, verify the actual license terms from the repository.
Quickstart
pip install sqlbag
import sqlbag
# Use sqlbag helpers for database connections, Flask setup, or temporary test databases
Python version support is unspecified; compatibility with modern Python and SQLAlchemy versions is unknown given the package's abandoned status.
Verify before relying
- Actual license terms—license_treatment is unclear and no SPDX identifier is present.
- Compatibility with current SQLAlchemy versions given the package has not been updated since 2021-04-01.
- Whether the runtime dependencies (six, sqlalchemy, packaging, pathlib) are pinned to specific versions or ranges.
Package facts
| License | not declared (unclear) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 4 — six, sqlalchemy, packaging, pathlib |
| Maintenance | abandoned — 1,961 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 258,130/month — #8,431 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: sqlbag-0.1.1617247075-py2.py3-none-any.whl
Tags
More Database packages
psycopg2-binary is a PostgreSQL database…
copyleft · top 1,000 on PyPI
redisPython client library for connecting to and…
permissive · top 1,000 on PyPI
ydbYDB Python SDK is the official client library…
permissive · top 1,000 on PyPI
snowflake-connector-pythonConnects Python applications to Snowflake data…
permissive · top 1,000 on PyPI
sqlparsesqlparse tokenizes SQL text into a tree of…
permissive · top 1,000 on PyPI
dbt-adaptersProvides base adapter protocols and shared…
permissive · top 1,000 on PyPI
Flask-SQLAlchemyFlask-SQLAlchemy integrates SQLAlchemy database…
permissive · top 1,000 on PyPI
Flask-TestingProvides unit testing utilities and helpers for…
permissive · top 15,000 on PyPI
SQLAlchemy-UtilsProvides utility functions, custom data types,…
permissive · top 1,000 on PyPI
SQLAlchemySQLAlchemy is a Python SQL toolkit and Object…
permissive · top 100 on PyPI
mixerMixer generates test data and model instances…
permissive · top 15,000 on PyPI
sqlalchemy-mateSimplifies SQLAlchemy code with helper…
permissive · top 5,000 on PyPI
sqlalchemy-cockroachdbA SQLAlchemy dialect that enables ORM and SQL…
permissive · top 5,000 on PyPI
sqlalchemy-viewsAdds CreateView and DropView SQL constructs to…
permissive · top 15,000 on PyPI
sqltapsqltap hooks into SQLAlchemy to collect and…
permissive · top 15,000 on PyPI
sqlalchemy-mixinsProvides Active Record-style mixins for…
permissive · top 15,000 on PyPI