db-connection
Set up database connections
This skill provides expert guidance for configuring database connections in Python and FastAPI applications. It covers Neon PostgreSQL setup, connection pooling, SSL configuration, and SQLAlchemy engine creation with best practices for production deployments.
์คํฌ ZIP ๋ค์ด๋ก๋
Claude์์ ์ ๋ก๋
์ค์ โ ๊ธฐ๋ฅ โ ์คํฌ โ ์คํฌ ์ ๋ก๋๋ก ์ด๋
ํ ๊ธ์ ์ผ๊ณ ์ฌ์ฉ ์์
ํ ์คํธํด ๋ณด๊ธฐ
"db-connection" ์ฌ์ฉ ์ค์ ๋๋ค. Set up a database connection for my FastAPI app using Neon PostgreSQL
์์ ๊ฒฐ๊ณผ:
- Engine created successfully with pool_size=5
- Connection string validated with SSL mode: require
- Session factory configured for dependency injection
- Health check endpoint available at /health/db
"db-connection" ์ฌ์ฉ ์ค์ ๋๋ค. Configure connection pool settings for my production application
์์ ๊ฒฐ๊ณผ:
- Pool size adjusted to 10 connections
- Max overflow set to 20
- Pool timeout configured at 30 seconds
- Connection recycle set to 1800 seconds
- Pool pre-ping enabled for connection health
"db-connection" ์ฌ์ฉ ์ค์ ๋๋ค. Add a database health check endpoint
์์ ๊ฒฐ๊ณผ:
- Created GET /health/db endpoint
- Returns status: healthy or unhealthy
- Includes latency measurement in milliseconds
- Shows database connection pool statistics
๋ณด์ ๊ฐ์ฌ
์์ This skill is a documentation-based skill containing database connection examples. The only script (verify.py) only reads and validates the SKILL.md file. All static findings are false positives: regex flags were misidentified as cryptographic algorithms, markdown backticks as shell commands, and standard documentation URLs as hardcoded targets. No network calls, no command execution, no credential exfiltration detected.
์ํ ์์ธ
โก ์คํฌ๋ฆฝํธ ํฌํจ (1)
๐ ํ์ผ ์์คํ ์ก์ธ์ค (1)
ํ์ง ์ ์
๋ง๋ค ์ ์๋ ๊ฒ
Connect FastAPI to Neon
Configure SQLAlchemy engine and session management for FastAPI applications with Neon PostgreSQL
Tune connection pools
Optimize pool size, timeout, and recycle settings for serverless and production environments
Add health checks
Implement database health check endpoints for monitoring and deployment verification
์ด ํ๋กฌํํธ๋ฅผ ์ฌ์ฉํด ๋ณด์ธ์
Set up a database connection for my FastAPI app using Neon PostgreSQL. I need SQLAlchemy engine configuration with connection pooling.
Configure connection pool settings for my production FastAPI application. Current issues: slow responses under load, connection timeouts.
Add a database health check endpoint to my FastAPI app. It should return status, latency, and pool statistics.
Optimize database connection settings for Vercel serverless functions. I need to avoid connection limit errors.
๋ชจ๋ฒ ์ฌ๋ก
- Use pool_pre_ping to verify connections before use and avoid stale connections
- Always close database sessions in finally blocks or use context managers
- Configure appropriate timeouts and pool recycling to prevent connection leaks
ํผํ๊ธฐ
- Creating new database connections for each request instead of using connection pooling
- Leaving connections open without proper cleanup, causing pool exhaustion
- Hardcoding connection URLs instead of using environment variables with SecretStr
์์ฃผ ๋ฌป๋ ์ง๋ฌธ
Which Python versions are supported?
What database platforms are supported?
How do I integrate with existing FastAPI apps?
Is my connection data secure?
Why am I getting connection timeout errors?
How does this differ from @sqlmodel-crud?
๊ฐ๋ฐ์ ์ธ๋ถ ์ ๋ณด
์์ฑ์
Awais68๋ผ์ด์ ์ค
MIT
๋ฆฌํฌ์งํ ๋ฆฌ
https://github.com/Awais68/hackathon-2-phase-ii-full-stack-web-app/tree/main/.claude/skills/db-connection์ฐธ์กฐ
main