axum-impl-database

Official

Wire sqlx pools safely into Axum

AuthorImpertio-Studio
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Prevents common, high-impact database integration failures in Axum by ensuring a sqlx connection pool is created once and reused correctly across handlers.

Core Features & Use Cases

  • Correct sqlx pool lifecycle: build the PgPool once in startup and share it via router state rather than creating per-request pools.
  • Safe pool usage in handlers: use State<PgPool> (no Arc or Mutex) and return Result instead of calling unwrap on query results.
  • Reliability under load: always set acquire_timeout to avoid requests hanging forever when the pool is saturated.
  • Version-aware extractor support: migrate or implement the DatabaseConnection FromRequestParts extractor for Axum 0.7 vs 0.8.
  • Query patterns and transactions: choose compile-time checked query macros vs runtime query functions and run atomic transactions with drop-rollback safety.

Quick Start

Use the axum-impl-database skill to design your sqlx PgPool setup, handler query code, and the correct Axum 0.7/0.8 DatabaseConnection extractor for your service.

Dependency Matrix

Required Modules

None required

Components

references

💻 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: axum-impl-database
Download link: https://github.com/Impertio-Studio/Axum-Claude-Skill-Package/archive/main.zip#axum-impl-database

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.