skills/ozerohax/assistagents/coder-rust-sqlx-config

coder-rust-sqlx-config

SKILL.md

<skill_overview> Configure SQLx safely and consistently across environments Setting up a database pool Adding or running migrations Configuring database URLs and features Bootstrapping DB on startup SQLx GitHub </skill_overview> Use a single shared pool for the app lifetime Configure max connections based on DB limits Store the pool in app state and reuse it let pool = sqlx::PgPool::connect(&database_url).await?; Use DATABASE_URL from environment, never hardcode creds Enable only the database and runtime features you need Fail fast if the database is unreachable at startup Generate migrations with sqlx migrate add Keep migrations in a dedicated migrations/ directory Apply migrations via sqlx migrate run or migrate! at startup In production, apply migrations in a controlled step sqlx::migrate!("./migrations").run(&pool).await?; Use separate databases for dev, test, and prod Never run destructive migrations against prod by default

Weekly Installs
3
GitHub Stars
25
First Seen
Feb 4, 2026
Installed on
gemini-cli3
opencode3
trae2
replit2
qwen-code2
claude-code2