Cargo Features

[dependencies]
sqlx = { version = "0.9.0-alpha.1", default-features = false, features = ["derive", "macros", "migrate", "sqlx-toml", "all-databases", "runtime-async-global-executor", "runtime-async-std", "runtime-smol", "runtime-tokio", "tls-native-tls", "tls-rustls", "tls-rustls-aws-lc-rs", "tls-rustls-ring", "tls-rustls-ring-webpki", "tls-rustls-ring-native-roots", "tls-none", "any", "postgres", "mysql", "sqlite", "sqlite-bundled", "sqlite-unbundled", "sqlite-deserialize", "sqlite-load-extension", "sqlite-preupdate-hook", "sqlite-unlock-notify", "json", "bigdecimal", "bit-vec", "chrono", "ipnet", "ipnetwork", "mac_address", "rust_decimal", "time", "uuid", "regexp", "bstr"] }
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

Affects sqlx::spec_error

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

sqlx-toml

Enable parsing of sqlx.toml for configuring macros and migrations.

Enables sqlx-toml of sqlx-core, optional sqlx-macros, and optional sqlx-sqlite

all-databases = any, mysql, postgres, sqlite

intended mainly for CI and docs

runtime-async-global-executor

Base runtime features without TLS

Enables optional sqlx-macros, _rt-async-io, _rt-async-task and async-global-executor of sqlx-core

runtime-async-std

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

runtime-smol

Enables optional sqlx-macros, async-fs, async-io, async-task and smol of sqlx-core

runtime-tokio

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

tls-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 and webpki-roots of sqlx-core

tls-rustls-ring tls-rustls? = tls-rustls-ring-webpki

For backwards compatibility

tls-rustls-ring-webpki tls-rustls-ring?

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

tls-rustls-ring-native-roots

Enables optional sqlx-macros, rustls and rustls-native-certs of sqlx-core

tls-none

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

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? = sqlite-bundled, sqlite-deserialize, sqlite-load-extension, sqlite-unlock-notify
sqlite-bundled sqlite?

SQLite base features

Enables bundled of sqlx-sqlite, sqlite of optional sqlx-macros

sqlite-unbundled

Enables unbundled of sqlx-sqlite, sqlite-unbundled of optional sqlx-macros

sqlite-deserialize sqlite?

SQLite features using conditionally compiled APIs Note: these assume sqlite-bundled or sqlite-unbundled is also enabled

Enable SqliteConnection::deserialize() and ::serialize() Cannot be used with -DSQLITE_OMIT_DESERIALIZE; requires -DSQLITE_ENABLE_DESERIALIZE on SQLite < 3.36.0

Enables deserialize of sqlx-sqlite

sqlite-load-extension sqlite?

Enable SqliteConnectOptions::extension() and ::extension_with_entrypoint(). Also required to use drivers.sqlite.unsafe-load-extensions from sqlx.toml. Cannot be used with -DSQLITE_OMIT_LOAD_EXTENSION

Enables load-extension of sqlx-sqlite, sqlite-load-extension of optional sqlx-macros

sqlite-preupdate-hook

Enables sqlite3_preupdate_hook Requires -DSQLITE_ENABLE_PREUPDATE_HOOK (set automatically with sqlite-bundled)

Enables preupdate-hook of sqlx-sqlite

sqlite-unlock-notify sqlite?

Enable internal handling of SQLITE_LOCKED_SHAREDCACHE Requires -DSQLITE_ENABLE_UNLOCK_NOTIFY (set automatically with sqlite-bundled)

Enables unlock-notify of sqlx-sqlite

json default

types

Enables json of sqlx-core, 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

ipnet

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

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

bstr

Enables bstr of sqlx-core

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-bundled? sqlite-deserialize? sqlite-load-extension? sqlite-preupdate-hook? sqlite-unbundled? sqlite-unlock-notify?