{"categories":[{"label":"Python Modules","url":"https://skillfed.io/packages/category/software-development-libraries-python-modules/19"},{"label":"Dynamic Content","url":"https://skillfed.io/packages/category/internet-www-http-dynamic-content/3"},{"label":"HTTP Servers","url":"https://skillfed.io/packages/category/internet-www-http-http-servers"}],"enrichment":{"capability":"Provides middleware and helpers to integrate SQLAlchemy database sessions with FastAPI applications, enabling both request-scoped and background task database access.","skillfed_tags":["fastapi","sqlalchemy","orm"],"use_cases":["Add SQLAlchemy ORM support to a new FastAPI REST API without writing custom session management code.","Query a database from FastAPI route handlers using the global `db.session` object.","Access the database in background tasks or scheduled jobs using `db()` as a context manager.","Migrate a Flask-SQLAlchemy application to FastAPI while keeping similar session patterns."],"what_it_does":"FastAPI-SQLAlchemy is a thin integration layer that attaches SQLAlchemy session management to FastAPI applications via middleware. It provides a global `db` object that gives routes automatic access to a request-scoped database session, and also supports out-of-request database access (e.g., in background tasks) by using the same `db` object as a context manager. The package relies on Python 3.7+ ContextVar to isolate sessions per request, ensuring thread-safe and async-safe behavior.\n\nThe package is designed for developers who want to use SQLAlchemy's ORM with FastAPI without manually managing session lifecycles in each route. It abstracts away the boilerplate of creating, binding, and cleaning up sessions, letting you focus on query logic. However, because the package entered dormancy after 2020, it may not reflect current best practices or compatibility with recent FastAPI and SQLAlchemy releases.","worth_installing":"Yes, if you are starting a new FastAPI project with SQLAlchemy and are comfortable with a dormant package. The integration is straightforward and low-friction. No, if you require active maintenance, up-to-date compatibility with the latest FastAPI and SQLAlchemy versions, or ongoing support\u2014consider alternatives or manage sessions manually. The lack of updates since 2020 is a significant concern for long-term projects."},"id":"fastapi-sqlalchemy","links":{"html":"https://skillfed.io/packages/fastapi-sqlalchemy","md":"https://skillfed.io/packages/fastapi-sqlalchemy.md","pypi":"https://pypi.org/project/fastapi-sqlalchemy/"},"maintenance":{"status":"dormant"},"meta":{"latest_release":"2020-09-25","license_spdx":null,"license_treatment":"permissive","name":"FastAPI-SQLAlchemy","python_support":"supports_current","summary":"Adds simple SQLAlchemy support to FastAPI"},"popularity":{"monthly_downloads":109417,"position":12516,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"0.2.1"}
