Myfy Database Module

•
83
•

Integrates asynchronous SQLAlchemy database access with connection pooling and request-scoped sessions into Myfy applications.

The DataModule skill streamlines database management for Myfy applications by providing a robust wrapper for asynchronous SQLAlchemy. It simplifies complex tasks like connection pooling, transaction management, and session injection, ensuring that database operations are efficient and thread-safe within a request-scoped architecture. Whether you are defining declarative models, managing migrations via Alembic, or handling automated table creation in development, this module provides the patterns and configuration hooks necessary to build high-performance, data-driven backend services.

主要功能

01Request-scoped session management with automatic injection and cleanup
02Support for multiple database engines including PostgreSQL, MySQL, and SQLite
03Environment-aware table creation and integrated Alembic migration workflows
04Asynchronous SQLAlchemy integration for non-blocking database operations
05Advanced connection pooling with health checks and pre-ping functionality
0683 GitHub stars

使用场景

01Managing complex database schema definitions and version-controlled migrations
02Building scalable REST APIs that require automatic database session handling per request
03Implementing transactional logic across multiple database operations in a single API call