Agent skill · software engineering · aiskillstore
db-connection
Use when setting up database connections, especially for Neon PostgreSQL. Triggers for: Neon Postgres connection, connection pooling configuration, connection string management, SSL configuration, or SQLAlchemy engine setup. NOT for: CRUD operations (use @sqlmodel-crud) or migration scripts (use @db-migration).
Why this skill is useful
Provides specific connection pooling configurations and SQLAlchemy engine setup for Neon PostgreSQL that the AI wouldn't reliably generate on its own.
What it needs
About 6k tokens when loaded. Last updated 2026-08-07. 405 stars on the source repository.
What this skill does
Database Connection Skill Expert database connection management for Python/FastAPI with Neon PostgreSQL, connection pooling, and SSL configuration. Quick Reference Task File/Method ------ ------------- Get engine getengine() Get session getsession() Connection string DBURL from settings Health check checkconnection() Project Structure Connection Configuration Settings with DB URL Environment Variables SQLAlchemy Engine Setup Connection Module Session Management Neon PostgreSQL Setup Neon Connection String Format Components: user: Database username (from Neon) password: Database password (from Neon) host: Endpoint ID + region, e.g., ep-xxx-12345.us-east-1.aws.neon.tech dbname: Your database name sslmode: Must be require for Neon Getting Connection Details from Neon 1. Go to Neon Dashboard 2. Select your project 3. Go to Connection Details 4. Copy the connection string 5. Add to Vercel/Dashboard environment variables Connection Pooling for Neon FastAPI Integration Application Setup Database Health Check SSL Configuration Required SSL Settings Testing SSL Connection Connection Pool Monitoring Pool Statistics Logging Queries (Debug) Alembic Integration env.py Configuration Quality Checklist [ ] Connections reused: Use poolpreping, don't create new connections [ ] No connection leaks: Always close sessions in finally blocks [ ] Production SSL enabled: ?sslmode=require in connection string [ ] Local dev easy: Can connect from local environment [ ] Timeouts configured: Pool timeout, statement timeout set [ ] Pool size tuned: Appropriate for expected concurrency [ ] Health check endpoint: /health/db returns status Integration Points Skill Integration ------- ------------- @env-config Read DBURL and pool settings from environment @sqlmodel-crud Uses session from getdb() dependency @db-migration Uses same engine/connection logic @fastapi-app Database dependency injection @error-handling Handle connection errors gracefully Troubleshooting Connection Refused Too Many Connection …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills aiskillstore/db-connection