2019-11-21 23:29:40 +00:00
[ workspace ]
members = [
"." ,
2019-11-22 10:30:16 +00:00
"sqlx-core" ,
2019-11-21 23:29:40 +00:00
"sqlx-macros" ,
2023-02-01 16:47:29 -08:00
"sqlx-macros-core" ,
2020-03-01 20:07:59 -08:00
"sqlx-test" ,
2020-05-15 20:07:57 -07:00
"sqlx-cli" ,
2024-03-11 18:46:53 -07:00
# "sqlx-bench",
2023-02-01 16:47:29 -08:00
"sqlx-mysql" ,
"sqlx-postgres" ,
"sqlx-sqlite" ,
2023-07-03 14:37:37 -07:00
"examples/mysql/todos" ,
"examples/postgres/axum-social-with-tests" ,
2023-07-25 01:09:06 +02:00
"examples/postgres/chat" ,
2023-07-03 14:37:37 -07:00
"examples/postgres/files" ,
"examples/postgres/json" ,
"examples/postgres/listen" ,
"examples/postgres/todos" ,
"examples/postgres/mockable-todos" ,
"examples/postgres/transaction" ,
"examples/sqlite/todos" ,
2019-11-21 23:29:40 +00:00
]
2023-02-01 16:47:29 -08:00
[ workspace . package ]
2025-01-03 20:28:57 -08:00
version = "0.8.3"
2019-06-06 06:02:55 -07:00
license = "MIT OR Apache-2.0"
2022-04-15 21:52:00 +02:00
edition = "2021"
2023-02-01 16:47:29 -08:00
repository = "https://github.com/launchbadge/sqlx"
2021-04-15 18:38:50 -07:00
keywords = [ "database" , "async" , "postgres" , "mysql" , "sqlite" ]
categories = [ "database" , "asynchronous" ]
2019-11-20 17:05:21 +00:00
authors = [
2021-04-15 18:38:50 -07:00
"Ryan Leckey <leckey.ryan@gmail.com>" ,
"Austin Bonander <austin.bonander@gmail.com>" ,
"Chloe Ross <orangesnowfox@gmail.com>" ,
"Daniel Akhterov <akhterovd@gmail.com>" ,
2021-05-21 17:27:15 -07:00
]
2024-09-02 13:13:01 -07:00
# TODO: enable this for 0.9.0
# rust-version = "1.80.0"
2019-06-06 06:02:55 -07:00
2023-02-01 16:47:29 -08:00
[ package ]
name = "sqlx"
readme = "README.md"
documentation = "https://docs.rs/sqlx"
description = "🧰 The Rust SQL Toolkit. An async, pure Rust SQL crate featuring compile-time checked queries without a DSL. Supports PostgreSQL, MySQL, and SQLite."
version . workspace = true
license . workspace = true
edition . workspace = true
authors . workspace = true
repository . workspace = true
2020-01-11 03:30:03 -08:00
[ package . metadata . docs . rs ]
2023-03-16 17:11:46 -07:00
features = [ "all-databases" , "_unstable-all-types" ]
2020-01-22 13:10:10 -08:00
rustdoc-args = [ "--cfg" , "docsrs" ]
2020-01-11 03:30:03 -08:00
2019-08-06 23:20:50 -07:00
[ features ]
2023-02-01 16:47:29 -08:00
default = [ "any" , "macros" , "migrate" , "json" ]
2024-03-30 19:24:56 -03:00
derive = [ "sqlx-macros/derive" ]
macros = [ "derive" , "sqlx-macros/macros" ]
2023-02-01 16:47:29 -08:00
migrate = [ "sqlx-core/migrate" , "sqlx-macros?/migrate" , "sqlx-mysql?/migrate" , "sqlx-postgres?/migrate" , "sqlx-sqlite?/migrate" ]
2020-04-13 23:00:19 -07:00
2020-03-24 02:56:52 -07:00
# intended mainly for CI and docs
2023-02-01 16:47:29 -08:00
all-databases = [ "mysql" , "sqlite" , "postgres" , "any" ]
_unstable-all-types = [
2021-04-15 18:38:50 -07:00
"bigdecimal" ,
2023-02-01 16:47:29 -08:00
"rust_decimal" ,
2021-04-15 18:38:50 -07:00
"json" ,
"time" ,
"chrono" ,
"ipnetwork" ,
2021-07-20 01:55:53 +02:00
"mac_address" ,
2021-04-15 18:38:50 -07:00
"uuid" ,
"bit-vec" ,
]
2020-03-24 02:56:52 -07:00
2023-02-01 16:47:29 -08:00
# Base runtime features without TLS
2023-07-07 01:01:21 +02:00
runtime-async-std = [ "_rt-async-std" , "sqlx-core/_rt-async-std" , "sqlx-macros?/_rt-async-std" ]
runtime-tokio = [ "_rt-tokio" , "sqlx-core/_rt-tokio" , "sqlx-macros?/_rt-tokio" ]
2020-10-20 12:29:24 +02:00
2023-02-01 16:47:29 -08:00
# TLS features
2023-07-07 01:01:21 +02:00
tls-native-tls = [ "sqlx-core/_tls-native-tls" , "sqlx-macros?/_tls-native-tls" ]
2024-08-05 01:39:13 +02:00
tls-rustls = [ "tls-rustls-ring" ] # For backwards compatibility
tls-rustls-aws-lc-rs = [ "sqlx-core/_tls-rustls-aws-lc-rs" , "sqlx-macros?/_tls-rustls-aws-lc-rs" ]
2024-11-28 01:39:18 +01:00
tls-rustls-ring = [ "tls-rustls-ring-webpki" ] # For backwards compatibility
tls-rustls-ring-webpki = [ "sqlx-core/_tls-rustls-ring-webpki" , "sqlx-macros?/_tls-rustls-ring-webpki" ]
tls-rustls-ring-native-roots = [ "sqlx-core/_tls-rustls-ring-native-roots" , "sqlx-macros?/_tls-rustls-ring-native-roots" ]
2023-02-01 16:47:29 -08:00
# No-op feature used by the workflows to compile without TLS enabled. Not meant for general use.
tls-none = [ ]
# Legacy Runtime + TLS features
runtime-async-std-native-tls = [ "runtime-async-std" , "tls-native-tls" ]
2024-08-05 01:39:13 +02:00
runtime-async-std-rustls = [ "runtime-async-std" , "tls-rustls-ring" ]
2023-02-01 16:47:29 -08:00
runtime-tokio-native-tls = [ "runtime-tokio" , "tls-native-tls" ]
2024-08-05 01:39:13 +02:00
runtime-tokio-rustls = [ "runtime-tokio" , "tls-rustls-ring" ]
2020-10-20 12:21:01 +02:00
2020-10-20 12:29:24 +02:00
# for conditional compilation
_rt-async-std = [ ]
_rt-tokio = [ ]
2024-10-03 02:55:21 +08:00
_sqlite = [ ]
2019-12-27 17:31:01 -08:00
# database
2023-02-01 16:47:29 -08:00
any = [ "sqlx-core/any" , "sqlx-mysql?/any" , "sqlx-postgres?/any" , "sqlx-sqlite?/any" ]
postgres = [ "sqlx-postgres" , "sqlx-macros?/postgres" ]
mysql = [ "sqlx-mysql" , "sqlx-macros?/mysql" ]
2024-10-03 02:55:21 +08:00
sqlite = [ "_sqlite" , "sqlx-sqlite/bundled" , "sqlx-macros?/sqlite" ]
sqlite-unbundled = [ "_sqlite" , "sqlx-sqlite/unbundled" , "sqlx-macros?/sqlite-unbundled" ]
2019-12-27 17:31:01 -08:00
# types
2023-02-01 16:47:29 -08:00
json = [ "sqlx-macros?/json" , "sqlx-mysql?/json" , "sqlx-postgres?/json" , "sqlx-sqlite?/json" ]
bigdecimal = [ "sqlx-core/bigdecimal" , "sqlx-macros?/bigdecimal" , "sqlx-mysql?/bigdecimal" , "sqlx-postgres?/bigdecimal" ]
bit-vec = [ "sqlx-core/bit-vec" , "sqlx-macros?/bit-vec" , "sqlx-postgres?/bit-vec" ]
chrono = [ "sqlx-core/chrono" , "sqlx-macros?/chrono" , "sqlx-mysql?/chrono" , "sqlx-postgres?/chrono" , "sqlx-sqlite?/chrono" ]
ipnetwork = [ "sqlx-core/ipnetwork" , "sqlx-macros?/ipnetwork" , "sqlx-postgres?/ipnetwork" ]
mac_address = [ "sqlx-core/mac_address" , "sqlx-macros?/mac_address" , "sqlx-postgres?/mac_address" ]
rust_decimal = [ "sqlx-core/rust_decimal" , "sqlx-macros?/rust_decimal" , "sqlx-mysql?/rust_decimal" , "sqlx-postgres?/rust_decimal" ]
time = [ "sqlx-core/time" , "sqlx-macros?/time" , "sqlx-mysql?/time" , "sqlx-postgres?/time" , "sqlx-sqlite?/time" ]
uuid = [ "sqlx-core/uuid" , "sqlx-macros?/uuid" , "sqlx-mysql?/uuid" , "sqlx-postgres?/uuid" , "sqlx-sqlite?/uuid" ]
2023-02-14 20:56:40 +01:00
regexp = [ "sqlx-sqlite?/regexp" ]
2023-02-01 16:47:29 -08:00
[ workspace . dependencies ]
2023-02-21 13:34:42 -08:00
# Core Crates
2025-01-03 20:28:57 -08:00
sqlx-core = { version = "=0.8.3" , path = "sqlx-core" }
sqlx-macros-core = { version = "=0.8.3" , path = "sqlx-macros-core" }
sqlx-macros = { version = "=0.8.3" , path = "sqlx-macros" }
2023-02-21 13:34:42 -08:00
2023-02-01 16:47:29 -08:00
# Driver crates
2025-01-03 20:28:57 -08:00
sqlx-mysql = { version = "=0.8.3" , path = "sqlx-mysql" }
sqlx-postgres = { version = "=0.8.3" , path = "sqlx-postgres" }
sqlx-sqlite = { version = "=0.8.3" , path = "sqlx-sqlite" }
2023-02-01 16:47:29 -08:00
# Facade crate (for reference from sqlx-cli)
2025-01-03 20:28:57 -08:00
sqlx = { version = "=0.8.3" , path = "." , default-features = false }
2023-02-01 16:47:29 -08:00
# Common type integrations shared by multiple driver crates.
# These are optional unless enabled in a workspace crate.
2023-08-29 21:18:45 -03:00
bigdecimal = "0.4.0"
2023-02-01 16:47:29 -08:00
bit-vec = "0.6.3"
2024-07-22 17:53:12 -07:00
chrono = { version = "0.4.34" , default-features = false , features = [ "std" , "clock" ] }
2023-02-01 16:47:29 -08:00
ipnetwork = "0.20.0"
2023-06-12 15:44:55 -04:00
mac_address = "1.1.5"
2024-07-04 17:17:20 -07:00
rust_decimal = { version = "1.26.1" , default-features = false , features = [ "std" ] }
2024-04-12 07:26:12 +05:00
time = { version = "0.3.36" , features = [ "formatting" , "parsing" , "macros" ] }
2023-02-01 16:47:29 -08:00
uuid = "1.1.2"
# Common utility crates
dotenvy = { version = "0.15.0" , default-features = false }
# Runtimes
[ workspace . dependencies . async-std ]
2023-10-07 23:00:45 -05:00
version = "1.12"
2023-02-01 16:47:29 -08:00
[ workspace . dependencies . tokio ]
version = "1"
features = [ "time" , "net" , "sync" , "fs" , "io-util" , "rt" ]
default-features = false
2019-08-06 23:20:50 -07:00
2019-06-06 06:02:55 -07:00
[ dependencies ]
2023-07-03 14:37:37 -07:00
sqlx-core = { workspace = true , features = [ "offline" , "migrate" ] }
sqlx-macros = { workspace = true , optional = true }
2019-07-26 09:20:09 -07:00
2023-02-01 16:47:29 -08:00
sqlx-mysql = { workspace = true , optional = true }
sqlx-postgres = { workspace = true , optional = true }
sqlx-sqlite = { workspace = true , optional = true }
2019-08-28 11:01:55 -07:00
[ dev-dependencies ]
2021-12-29 17:25:49 -08:00
anyhow = "1.0.52"
2022-04-15 00:11:46 +02:00
time_ = { version = "0.3.2" , package = "time" }
2021-12-29 17:25:49 -08:00
futures = "0.3.19"
2024-01-26 02:30:25 -05:00
env_logger = "0.11"
2024-09-09 12:52:59 +08:00
async-std = { workspace = true , features = [ "attributes" ] }
2021-12-29 17:25:49 -08:00
tokio = { version = "1.15.0" , features = [ "full" ] }
2022-07-28 14:33:44 -07:00
dotenvy = "0.15.0"
2021-12-29 17:25:49 -08:00
trybuild = "1.0.53"
2020-03-01 20:07:59 -08:00
sqlx-test = { path = "./sqlx-test" }
2021-12-29 17:25:49 -08:00
paste = "1.0.6"
serde = { version = "1.0.132" , features = [ "derive" ] }
serde_json = "1.0.73"
url = "2.2.2"
2021-12-29 15:23:02 -08:00
rand = "0.8.4"
rand_xoshiro = "0.6.0"
2021-12-29 17:25:49 -08:00
hex = "0.4.3"
2024-07-20 03:50:18 +02:00
tempfile = "3.10.1"
2024-01-26 02:30:14 -05:00
criterion = { version = "0.5.1" , features = [ "async_tokio" ] }
2023-05-08 13:44:28 -06:00
2024-03-05 18:04:45 -08:00
# If this is an unconditional dev-dependency then Cargo will *always* try to build `libsqlite3-sys`,
# even when SQLite isn't the intended test target, and fail if the build environment is not set up for compiling C code.
[ target . 'cfg(sqlite_test_sqlcipher)' . dev-dependencies ]
# Enable testing with SQLCipher if specifically requested.
2024-07-28 02:59:00 +02:00
libsqlite3-sys = { version = "0.30.1" , features = [ "bundled-sqlcipher" ] }
2022-08-05 21:20:14 +02:00
2024-08-20 01:26:53 -07:00
# Common lint settings for the workspace
[ workspace . lints . clippy ]
# https://github.com/launchbadge/sqlx/issues/3440
cast_possible_truncation = 'deny'
cast_possible_wrap = 'deny'
cast_sign_loss = 'deny'
# See `clippy.toml`
disallowed_methods = 'deny'
2020-06-27 04:07:40 -07:00
#
# Any
#
[ [ test ] ]
name = "any"
path = "tests/any/any.rs"
2021-04-15 18:38:50 -07:00
required-features = [ "any" ]
2020-06-27 04:07:40 -07:00
2020-07-14 06:07:29 -07:00
[ [ test ] ]
name = "any-pool"
path = "tests/any/pool.rs"
2021-04-15 18:38:50 -07:00
required-features = [ "any" ]
2020-07-14 06:07:29 -07:00
2020-07-23 17:46:27 -04:00
#
# Migrations
#
[ [ test ] ]
name = "migrate-macro"
path = "tests/migrate/macro.rs"
2021-04-15 18:38:50 -07:00
required-features = [ "macros" , "migrate" ]
2020-07-23 17:46:27 -04:00
2020-05-30 14:51:57 -07:00
#
# SQLite
#
2020-01-28 18:56:25 -08:00
2020-03-11 11:01:17 -07:00
[ [ test ] ]
name = "sqlite"
2020-05-30 14:51:57 -07:00
path = "tests/sqlite/sqlite.rs"
2021-04-15 18:38:50 -07:00
required-features = [ "sqlite" ]
2020-03-11 11:01:17 -07:00
2023-07-14 20:27:53 -03:00
[ [ test ] ]
name = "sqlite-any"
path = "tests/sqlite/any.rs"
required-features = [ "sqlite" ]
2020-03-16 21:05:48 -07:00
[ [ test ] ]
2020-05-30 14:51:57 -07:00
name = "sqlite-types"
path = "tests/sqlite/types.rs"
2021-04-15 18:38:50 -07:00
required-features = [ "sqlite" ]
2020-03-13 02:21:29 -07:00
2020-03-20 10:21:15 +01:00
[ [ test ] ]
2020-05-30 14:51:57 -07:00
name = "sqlite-describe"
path = "tests/sqlite/describe.rs"
2021-04-15 18:38:50 -07:00
required-features = [ "sqlite" ]
2020-03-13 02:21:29 -07:00
2020-06-05 21:02:24 -07:00
[ [ test ] ]
name = "sqlite-macros"
path = "tests/sqlite/macros.rs"
2021-04-15 18:38:50 -07:00
required-features = [ "sqlite" , "macros" ]
2020-06-05 21:02:24 -07:00
2024-10-03 02:55:21 +08:00
[ [ test ] ]
name = "sqlite-unbundled-macros"
path = "tests/sqlite/macros.rs"
required-features = [ "sqlite-unbundled" , "macros" ]
2021-03-18 16:12:00 -07:00
[ [ test ] ]
name = "sqlite-derives"
path = "tests/sqlite/derives.rs"
2021-04-15 18:38:50 -07:00
required-features = [ "sqlite" , "macros" ]
2021-03-18 16:12:00 -07:00
2023-02-08 18:23:33 -03:00
[ [ test ] ]
name = "sqlite-error"
path = "tests/sqlite/error.rs"
required-features = [ "sqlite" ]
2022-08-05 21:20:14 +02:00
[ [ test ] ]
2023-02-01 16:47:29 -08:00
name = "sqlite-sqlcipher"
2022-08-05 21:20:14 +02:00
path = "tests/sqlite/sqlcipher.rs"
required-features = [ "sqlite" ]
2022-08-02 14:38:12 -07:00
[ [ test ] ]
name = "sqlite-test-attr"
path = "tests/sqlite/test-attr.rs"
required-features = [ "sqlite" , "macros" , "migrate" ]
2022-09-13 00:52:04 +00:00
[ [ test ] ]
name = "sqlite-migrate"
path = "tests/sqlite/migrate.rs"
required-features = [ "sqlite" , "macros" , "migrate" ]
2024-08-23 18:27:36 -07:00
[ [ test ] ]
name = "sqlite-rustsec"
path = "tests/sqlite/rustsec.rs"
required-features = [ "sqlite" ]
2023-05-08 13:44:28 -06:00
[ [ bench ] ]
name = "sqlite-describe"
path = "benches/sqlite/describe.rs"
harness = false
required-features = [ "sqlite" ]
2020-05-30 14:51:57 -07:00
#
# MySQL
#
2019-12-27 17:31:01 -08:00
[ [ test ] ]
name = "mysql"
2020-05-30 14:51:57 -07:00
path = "tests/mysql/mysql.rs"
2021-04-15 18:38:50 -07:00
required-features = [ "mysql" ]
2019-12-27 17:31:01 -08:00
2020-03-11 01:40:57 -07:00
[ [ test ] ]
2020-05-30 14:51:57 -07:00
name = "mysql-types"
path = "tests/mysql/types.rs"
2021-04-15 18:38:50 -07:00
required-features = [ "mysql" ]
2020-03-11 01:40:57 -07:00
2020-03-17 19:26:59 -07:00
[ [ test ] ]
2020-05-30 14:51:57 -07:00
name = "mysql-describe"
path = "tests/mysql/describe.rs"
2021-04-15 18:38:50 -07:00
required-features = [ "mysql" ]
2020-03-17 19:26:59 -07:00
2024-07-25 18:47:36 +09:00
[ [ test ] ]
name = "mysql-derives"
path = "tests/mysql/derives.rs"
required-features = [ "mysql" , "derive" ]
2020-06-05 21:02:24 -07:00
[ [ test ] ]
name = "mysql-macros"
path = "tests/mysql/macros.rs"
2021-04-15 18:38:50 -07:00
required-features = [ "mysql" , "macros" ]
2020-06-05 21:02:24 -07:00
2023-02-08 18:23:33 -03:00
[ [ test ] ]
name = "mysql-error"
path = "tests/mysql/error.rs"
required-features = [ "mysql" ]
2022-08-02 14:38:12 -07:00
[ [ test ] ]
name = "mysql-test-attr"
path = "tests/mysql/test-attr.rs"
required-features = [ "mysql" , "macros" , "migrate" ]
2022-09-13 00:52:04 +00:00
[ [ test ] ]
name = "mysql-migrate"
path = "tests/mysql/migrate.rs"
required-features = [ "mysql" , "macros" , "migrate" ]
2024-08-23 20:07:55 -07:00
[ [ test ] ]
name = "mysql-rustsec"
path = "tests/mysql/rustsec.rs"
required-features = [ "mysql" ]
2020-05-30 14:51:57 -07:00
#
# PostgreSQL
#
2019-12-27 17:31:01 -08:00
2020-03-01 02:01:00 -08:00
[ [ test ] ]
2020-05-30 14:51:57 -07:00
name = "postgres"
path = "tests/postgres/postgres.rs"
2021-04-15 18:38:50 -07:00
required-features = [ "postgres" ]
2020-03-01 02:01:00 -08:00
2019-11-23 09:02:56 +00:00
[ [ test ] ]
name = "postgres-types"
2020-05-30 14:51:57 -07:00
path = "tests/postgres/types.rs"
2021-04-15 18:38:50 -07:00
required-features = [ "postgres" ]
2019-11-23 09:02:56 +00:00
2020-03-17 19:26:59 -07:00
[ [ test ] ]
2020-05-30 14:51:57 -07:00
name = "postgres-describe"
path = "tests/postgres/describe.rs"
2021-04-15 18:38:50 -07:00
required-features = [ "postgres" ]
2020-06-02 20:47:57 -07:00
2020-06-05 20:28:21 -07:00
[ [ test ] ]
name = "postgres-macros"
path = "tests/postgres/macros.rs"
2021-04-15 18:38:50 -07:00
required-features = [ "postgres" , "macros" ]
2020-06-07 02:35:12 -07:00
2020-06-12 15:20:32 -07:00
[ [ test ] ]
name = "postgres-derives"
path = "tests/postgres/derives.rs"
2021-04-15 18:38:50 -07:00
required-features = [ "postgres" , "macros" ]
2020-06-12 15:20:32 -07:00
2023-02-08 18:23:33 -03:00
[ [ test ] ]
name = "postgres-error"
path = "tests/postgres/error.rs"
required-features = [ "postgres" ]
2022-08-02 14:38:12 -07:00
[ [ test ] ]
name = "postgres-test-attr"
path = "tests/postgres/test-attr.rs"
required-features = [ "postgres" , "macros" , "migrate" ]
2022-09-13 00:52:04 +00:00
[ [ test ] ]
name = "postgres-migrate"
path = "tests/postgres/migrate.rs"
required-features = [ "postgres" , "macros" , "migrate" ]
2024-07-26 23:15:32 -07:00
[ [ test ] ]
name = "postgres-query-builder"
path = "tests/postgres/query_builder.rs"
required-features = [ "postgres" ]
2024-08-23 01:25:25 -07:00
[ [ test ] ]
name = "postgres-rustsec"
path = "tests/postgres/rustsec.rs"
required-features = [ "postgres" , "macros" , "migrate" ]