Cargo Features

[dependencies]
sqlx = { version = "0.8.2", default-features = false, features = ["derive", "macros", "migrate", "all-databases", "runtime-async-std", "runtime-tokio", "tls-native-tls", "tls-rustls", "tls-rustls-aws-lc-rs", "tls-rustls-ring", "tls-none", "runtime-async-std-native-tls", "runtime-async-std-rustls", "runtime-tokio-native-tls", "runtime-tokio-rustls", "any", "postgres", "mysql", "sqlite", "json", "bigdecimal", "bit-vec", "chrono", "ipnetwork", "mac_address", "rust_decimal", "time", "uuid", "regexp"] }
default = any, json, macros, migrate

These default features are set whenever sqlx is added without default-features = false somewhere in the dependency tree.

derive macros

Enables derive of sqlx-macros

sqlx-macros:

SQLx features

macros default = derive

Enables macros of sqlx-macros

Affects sqlx::ty_match, sqlx::spec_error…

migrate default

Enables sqlx-core, migrate of optional sqlx-macros, optional sqlx-mysql, optional sqlx-postgres, and optional sqlx-sqlite

all-databases = any, mysql, postgres, sqlite

intended mainly for CI and docs

runtime-async-std runtime-async-std-native-tls? runtime-async-std-rustls?

Base runtime features without TLS

Enables optional sqlx-macros, async-io and async-std of sqlx-core

runtime-tokio runtime-tokio-native-tls? runtime-tokio-rustls?

Enables optional sqlx-macros, tokio and tokio-stream of sqlx-core

tls-native-tls runtime-async-std-native-tls? runtime-tokio-native-tls?

TLS features

Enables optional sqlx-macros, native-tls of sqlx-core

tls-rustls = tls-rustls-ring

For backwards compatibility

tls-rustls-aws-lc-rs

Enables optional sqlx-macros, rustls, rustls-pemfile and webpki-roots of sqlx-core

tls-rustls-ring runtime-async-std-rustls? runtime-tokio-rustls? tls-rustls?

Enables optional sqlx-macros, rustls, rustls-pemfile and webpki-roots of sqlx-core

tls-none

No-op feature used by the workflows to compile without TLS enabled. Not meant for general use.

runtime-async-std-native-tls = runtime-async-std, tls-native-tls

Legacy Runtime + TLS features

runtime-async-std-rustls = runtime-async-std, tls-rustls-ring
runtime-tokio-native-tls = runtime-tokio, tls-native-tls
runtime-tokio-rustls = runtime-tokio, tls-rustls-ring
any default all-databases?

database

Enables any of sqlx-core, optional sqlx-mysql, optional sqlx-postgres, and optional sqlx-sqlite

Affects sqlx::any…

postgres all-databases? = sqlx-postgres

Enables postgres of optional sqlx-macros

mysql all-databases? = sqlx-mysql

Enables mysql of optional sqlx-macros

sqlx-macros:

database

sqlite all-databases? = sqlx-sqlite

Enables sqlite of optional sqlx-macros

json default

types

Enables json of optional sqlx-macros, optional sqlx-mysql, optional sqlx-postgres, and optional sqlx-sqlite

bigdecimal

Enables bigdecimal of sqlx-core, optional sqlx-macros, optional sqlx-mysql, and optional sqlx-postgres

sqlx-macros:

type

bit-vec

Enables bit-vec of sqlx-core, optional sqlx-macros, and optional sqlx-postgres

chrono

Enables chrono of sqlx-core, optional sqlx-macros, optional sqlx-mysql, optional sqlx-postgres, and optional sqlx-sqlite

sqlx-sqlite:

Type integrations

ipnetwork

Enables ipnetwork of sqlx-core, optional sqlx-macros, and optional sqlx-postgres

mac_address

Enables mac_address of sqlx-core, optional sqlx-macros, and optional sqlx-postgres

rust_decimal

Enables rust_decimal of sqlx-core, optional sqlx-macros, optional sqlx-mysql, and optional sqlx-postgres

time

Enables time of sqlx-core, optional sqlx-macros, optional sqlx-mysql, optional sqlx-postgres, and optional sqlx-sqlite

uuid

Enables uuid of sqlx-core, optional sqlx-macros, optional sqlx-mysql, optional sqlx-postgres, and optional sqlx-sqlite

regexp

Enables regexp of optional sqlx-sqlite

Features from optional dependencies

In crates that don't use the dep: syntax, optional dependencies automatically become Cargo features. These features may have been created by mistake, and this functionality may be removed in the future.

sqlx-macros derive? macros
sqlx-mysql mysql?
sqlx-postgres postgres?
sqlx-sqlite sqlite?