What problem does it solve?
Rust developers building PostgreSQL-backed applications often struggle with safe, maintainable data access patterns, migrations, and reliable builds in CI. This Skill provides a structured approach for using sqlx to combine compile-time checks, runtime queries, and offline preparation.
Core Features & Use Cases
- Compile-time queries: Use the query! and query_as! macros to catch schema issues at compile time and ensure strong type safety.
- Runtime queries & FromRow: Flexible runtime querying for dynamic schemas and direct mapping into Rust structs.
- Migrations with sqlx-cli: Manage reversible migrations with a clear workflow and repeatable steps.
- Offline mode with prepare: Precompute query metadata to enable builds without live DB during CI or embedded deployments.
Quick Start
Install Rust toolchain, configure DATABASE_URL to a PostgreSQL database, run cargo check, then cargo sqlx prepare to cache queries for offline builds.