Platform Database Pattern
CommunityStandardize db usage to prevent leaks.
Software Engineering#fastapi#python#async#transactions#connection-pooling#db-parameter#database-pattern
Authoraaaa47080
Version1.0.0
Installs0
System Documentation
What problem does it solve?
This skill helps teams prevent database connection pool exhaustion by enforcing a standardized db parameter pattern across functions.
Core Features & Use Cases
- Standard Function Signature with db=None to control connections
- Use
conn = db or get_connection()to reuse or acquire connections safely - Ensure resources are closed in a
finallyblock, closing only when db is None to avoid leaks
Quick Start
Refactor a function to accept a db=None parameter and implement conn = db or get_connection() with proper try/finally cleanup.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: Platform Database Pattern Download link: https://github.com/aaaa47080/stock_agent/archive/main.zip#platform-database-pattern Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.