# launchbadge/sqlx

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/launchbadge-sqlx).**

16,630 stars · 1,560 forks · Rust · apache-2.0

## Links

- GitHub: https://github.com/launchbadge/sqlx
- awesome-repositories: https://awesome-repositories.com/repository/launchbadge-sqlx.md

## Topics

`async` `await` `mariadb` `mysql` `postgres` `postgresql` `rust` `sql` `sqlite`

## Description

This toolkit provides an asynchronous interface for interacting with relational databases, offering a unified driver-agnostic layer for managing connection pools and executing transactions. It is designed to integrate with asynchronous runtimes, enabling non-blocking database operations while maintaining secure, encrypted communication between the application and the database server.

The project distinguishes itself through its compile-time validation capabilities, which use procedural macros to inspect SQL syntax and parameter types against a live database schema during the build process. This approach ensures that queries are verified for correctness before the application is deployed. Additionally, it features automated type mapping that transforms database rows into strongly typed structures, reducing the need for manual data conversion.

Beyond its core validation and mapping features, the toolkit supports both dynamic and prepared SQL execution, with transparent caching of execution plans to optimize performance. It also includes a built-in migration manager that allows developers to bundle versioned schema scripts directly into the application binary, ensuring consistent database state management across different deployment environments.

## Tags

### Data & Databases

- [Asynchronous SQL Toolkits](https://awesome-repositories.com/f/data-databases/sql-database-connectors/asynchronous-sql-toolkits.md) — Provides a comprehensive asynchronous SQL toolkit featuring compile-time validation and type-safe row mapping.
- [Asynchronous Database Drivers](https://awesome-repositories.com/f/data-databases/asynchronous-database-drivers.md) — Provides asynchronous database drivers with built-in connection pooling and transaction management.
- [SQL Database Connectors](https://awesome-repositories.com/f/data-databases/sql-database-connectors.md) — Offers a library for executing SQL queries with compile-time verification and automated type mapping.
- [Connection Pooling](https://awesome-repositories.com/f/data-databases/connection-pooling.md) — Maintains persistent pools of database connections to optimize resource usage and improve application performance.
- [Database Query Execution](https://awesome-repositories.com/f/data-databases/database-query-execution.md) — Verifies SQL statements against a live database schema during compilation to ensure correctness. ([source](https://docs.rs/sqlx/index.html))
- [Database Abstraction Layers](https://awesome-repositories.com/f/data-databases/database-abstraction-layers.md) — Provides a unified API for interacting with multiple relational database engines and dialects.
- [Database Schema Migrations](https://awesome-repositories.com/f/data-databases/database-management-systems/database-systems-management/database-management/database-schema-migrations.md) — Bundles versioned schema migration scripts directly into the application binary for consistent database state management.
- [Database Connections](https://awesome-repositories.com/f/data-databases/database-management-systems/database-systems-management/database-systems/database-connections.md) — Provides asynchronous connection pooling to manage and optimize persistent database connections across concurrent application tasks. ([source](https://docs.rs/sqlx/0.9.0/sqlx/))
- [Database Migration Management](https://awesome-repositories.com/f/data-databases/database-migration-management.md) — Manages and executes versioned schema migration scripts embedded directly within the application binary.
- [Type-Safe Database Clients](https://awesome-repositories.com/f/data-databases/type-safe-database-clients.md) — Ensures compile-time safety by mapping database results to strongly typed language structures.
- [Database Drivers](https://awesome-repositories.com/f/data-databases/database-drivers.md) — Offers a unified abstraction layer to interact with multiple relational database engines through consistent driver interfaces. ([source](https://docs.rs/sqlx/0.9.0/sqlx/))
- [Database Migrations](https://awesome-repositories.com/f/data-databases/database-migrations.md) — Supports versioning and applying schema changes to database structures through embedded scripts.
- [Prepared Statement Engines](https://awesome-repositories.com/f/data-databases/database-drivers/prepared-statement-engines.md) — Caches database-side execution plans to reduce parsing overhead and improve query performance.
- [SQL Query Builders](https://awesome-repositories.com/f/data-databases/sql-query-builders.md) — Constructs complex SQL statements programmatically while maintaining safety through automatic parameter binding. ([source](https://docs.rs/sqlx/0.9.0/sqlx/))

### Testing & Quality Assurance

- [Compile-Time Validators](https://awesome-repositories.com/f/testing-quality-assurance/validation-verification/input-validation/compile-time-validators.md) — Checks SQL syntax and parameter types against the database schema during compilation. ([source](https://docs.rs/sqlx/0.9.0/sqlx/))
- [SQL Query Validators](https://awesome-repositories.com/f/testing-quality-assurance/validation-verification/input-validation/compile-time-validators/sql-query-validators.md) — Verifies SQL syntax and parameter types against a live database schema during compilation to prevent runtime errors.

### Web Development

- [SQL Schema Validators](https://awesome-repositories.com/f/web-development/schema-validation/sql-schema-validators.md) — Verifies SQL syntax and parameter types against live database schemas during compilation to prevent runtime errors.

### Programming Languages & Runtimes

- [Database Row Mappers](https://awesome-repositories.com/f/programming-languages-runtimes/programming-language-varieties/programming-languages/type-systems/trait-based-polymorphism/traits/database-row-mappers.md) — Automatically transforms raw database rows into strongly typed language structures using trait-based reflection.
- [Asynchronous Bridge Runtimes](https://awesome-repositories.com/f/programming-languages-runtimes/runtime-execution-environments/runtime-environments/runtimes/asynchronous-execution-engines/asynchronous-bridge-runtimes.md) — Integrates with asynchronous runtimes to enable non-blocking database operations. ([source](https://docs.rs/sqlx))

### Security & Cryptography

- [Secure Connection Handlers](https://awesome-repositories.com/f/security-cryptography/secure-connection-handlers.md) — Implements secure connection handling with configurable security backends for safe database communication. ([source](https://docs.rs/sqlx))
- [Transport Layer Security](https://awesome-repositories.com/f/security-cryptography/transport-layer-security.md) — Supports encrypted database communication using transport layer security to protect sensitive data in transit. ([source](https://docs.rs/sqlx/0.9.0/sqlx/))
