Skip to content
whichdevtool?
Categories ▾

Frameworks and UI

Frontend and full-stack frameworks Backend frameworks UI component libraries

Hosting

VPS and cloud servers App hosting and PaaS

Data

Managed databases File and object storage ORMs and database toolkits

AI

AI model APIs

Email

Transactional email APIs Email marketing and newsletters

Payments

Payments and billing

Domains and edge

Domain registrars CDN, DNS and edge security

Operations and identity

Monitoring, uptime and error tracking Auth and identity Background jobs, queues and workflows
Stacks Directory
Ctrl K

Search directory
Menu
StacksDirectory Pricing changes Glossary
VPS and cloud servers App hosting and PaaS Managed databases Transactional email APIs Email marketing and newsletters Domain registrars CDN, DNS and edge security Monitoring, uptime and error tracking Auth and identity Frontend and full-stack frameworks Backend frameworks UI component libraries AI model APIs File and object storage Payments and billing Background jobs, queues and workflows ORMs and database toolkits
  1. Home
  2. ORMs and database toolkits
  3. SQLx
SQ

Async Rust SQL toolkit · by SQLx (transact-rs)

SQLx

Async, pure-Rust SQL toolkit whose macros check hand-written SQL against a real database at compile time; supports PostgreSQL, MySQL, MariaDB and SQLite, with a CLI for migrations.

Visit github.com ↗ Alternatives Open source Open source Self-hostable
github.com
SQLx homepage
§1

Overview

SQLx has been developed since late 2019. Its README describes it as an async, pure-Rust SQL crate with compile-time checked queries and no DSL. With the query! and query_as! macros, SQL is checked against a live development database (or offline metadata committed to the repo) during compilation, and the result types are inferred from it. Plain query() functions are available when you do not want compile-time checks.

It ships connection pooling, row streaming, prepared statement caching, nested transactions with save points, LISTEN/NOTIFY for PostgreSQL and an Any driver for choosing the database at run time. SQL Server support was removed in 0.7 pending a rewrite. The Postgres and MySQL drivers are pure Rust; SQLite uses the C library.

SQLx 0.9.0 was released on 6 May 2026. It added a sqlx.toml config for multi-database setups and type overrides, the smol and async-global-executor runtimes to replace async-std, and a SqlSafeStr requirement on query strings to discourage SQL injection. With that release the repository moved from LaunchBadge to the transact-rs organisation, because LaunchBadge had not owned or maintained it for some years.

§2

Pricing and plans

Plan Price What you get
SQLx $0 Dual-licensed: MIT or Apache 2.0

Free and open source; there is no paid product.

Source: github.com/transact-rs/sqlx · prices as published, excluding tax.

§3

What it does

Compile-time checked SQL
query! macros verify SQL and infer column types against a development database or offline metadata.
Async and runtime-agnostic
Works with tokio, actix, smol and async-global-executor, with rustls or native-tls.
Pooling and streaming
Built-in connection pool, row streaming and statement caching.
Migrations
sqlx-cli creates and runs migrations, which can also be embedded in the binary.
sqlx.toml
Since 0.9, a config file for multiple databases, global type overrides and SQLite extensions.
§4

Strengths and limitations

Strengths

  • You write real SQL and still get type-checked results
  • Async-first and widely used as the base for other crates, including SeaORM
  • Pure Rust drivers for PostgreSQL and MySQL
  • No DSL to learn

Limitations

  • Compile-time checks need a reachable database or prepared offline metadata in CI
  • Not an ORM: no relations, change tracking or query building beyond a basic QueryBuilder
  • SQL Server support was removed in 0.7
  • 0.9 changed query() to require SqlSafeStr, so dynamic strings must be wrapped in AssertSqlSafe
§5

Who it suits

Good for

  • Async Rust services on PostgreSQL
  • Developers who want SQL with type safety and no ORM
  • Teams that review SQL directly

Look elsewhere if

  • Projects that need SQL Server
  • Teams that want an ORM with relations (SeaORM or Diesel)
§6

Pricing history

  • 6 May 2026

    SQLx 0.9 released; repository moves to transact-rs

    SQLx 0.9.0 added sqlx.toml, new runtimes and the SqlSafeStr requirement for query strings; the repository then moved from LaunchBadge to the transact-rs GitHub organisation. Source ↗

§7

Alternatives to SQLx

Tool From Free option Stages
EF
Entity Framework Core .NET ORM
— Open source
Bu
Bun (Go ORM) SQL-first Go ORM
— Open source
Ky
Kysely Type-safe TypeScript SQL query builder
— Open source
SO
SeaORM Async dynamic ORM for Rust
— Open source
AR
Active Record (Rails) Active Record ORM for Ruby on Rails
— Open source
SQLAlchemy Python SQL toolkit and ORM
— Open source

All ORMs and database toolkits →

§8

Questions

Is SQLx an ORM?

No. The project says so itself; it is an async SQL toolkit with compile-time checked queries.

How does SQLx check queries at compile time?

The query! macros connect to a development database, or read offline metadata, during compilation to validate SQL and infer types.

Where did SQLx move?

After the 0.9.0 release in May 2026 the repository moved from the LaunchBadge organisation to transact-rs on GitHub.

Sources read for this page

  • https://github.com/launchbadge/sqlx
  • https://github.com/transact-rs/sqlx
  • https://github.com/launchbadge/sqlx/blob/HEAD/CHANGELOG.md
  • https://github.com/launchbadge/sqlx/discussions/4271
Spec sheet
From
Open source
Free tier
Free to self-host
Stages
HobbyIndieStartupScale-upEnterprise Suits hobby, indie, startup, scale-up
Language
Rust
Approach
SQL-first toolkit with compile-time checked queries
Databases
PostgreSQL, MySQL, MariaDB, SQLite
Migrations
Yes, sqlx-cli and embedded migrations
Open source
Yes
Self-host
Yes
EU data
Not stated
Category
ORMs
Visit github.com ↗

To report an out-of-date price or limit, use the correction form.

whichdevtool?

Developer and cloud tools compared on price, free tier and limits, each with its source. For side projects, solo developers and small teams.

Categories

  • VPS and cloud servers
  • App hosting and PaaS
  • Managed databases
  • Transactional email APIs
  • Email marketing and newsletters
  • Domain registrars
  • CDN, DNS and edge security
  • Monitoring, uptime and error tracking
  • Auth and identity
  • Frontend and full-stack frameworks
  • Backend frameworks
  • UI component libraries
  • AI model APIs
  • File and object storage
  • Payments and billing
  • Background jobs, queues and workflows
  • ORMs and database toolkits

Research

  • Directory
  • Stacks by project
  • Developer news
  • Pricing changes
  • Glossary

Site

  • About and methods
  • How we make money
  • Suggest a tool or fix
  • Privacy
© 2026 whichdevtool.com Prices change. Each tool page links to its source. We may earn a commission when you sign up through links on this site. How we make money