| 1 |
[workspace] |
| 2 |
members = [ |
| 3 |
".", |
| 4 |
"sqlx-core", |
| 5 |
"sqlx-macros", |
| 6 |
"sqlx-macros-core", |
| 7 |
"sqlx-test", |
| 8 |
"sqlx-cli", |
| 9 |
# "sqlx-bench", |
| 10 |
"sqlx-mysql", |
| 11 |
"sqlx-postgres", |
| 12 |
"sqlx-sqlite", |
| 13 |
"examples/mysql/todos", |
| 14 |
"examples/postgres/axum-social-with-tests", |
| 15 |
"examples/postgres/chat", |
| 16 |
"examples/postgres/files", |
| 17 |
"examples/postgres/json", |
| 18 |
"examples/postgres/listen", |
| 19 |
"examples/postgres/todos", |
| 20 |
"examples/postgres/mockable-todos", |
| 21 |
"examples/postgres/transaction", |
| 22 |
"examples/sqlite/todos", |
| 23 |
] |
| 24 |
|
| 25 |
[workspace.package] |
| 26 |
version = "0.8.3" |
| 27 |
license = "MIT OR Apache-2.0" |
| 28 |
edition = "2021" |
| 29 |
repository = "https://github.com/launchbadge/sqlx" |
| 30 |
keywords = ["database", "async", "postgres", "mysql", "sqlite"] |
| 31 |
categories = ["database", "asynchronous"] |
| 32 |
authors = [ |
| 33 |
"Ryan Leckey <[email protected]>", |
| 34 |
"Austin Bonander <[email protected]>", |
| 35 |
"Chloe Ross <[email protected]>", |
| 36 |
"Daniel Akhterov <[email protected]>", |
| 37 |
] |
| 38 |
# TODO: enable this for 0.9.0 |
| 39 |
# rust-version = "1.80.0" |
| 40 |
|
| 41 |
[package] |
| 42 |
name = "sqlx" |
| 43 |
readme = "README.md" |
| 44 |
documentation = "https://docs.rs/sqlx" |
| 45 |
description = "🧰 The Rust SQL Toolkit. An async, pure Rust SQL crate featuring compile-time checked queries without a DSL. Supports PostgreSQL, MySQL, and SQLite." |
| 46 |
version.workspace = true |
| 47 |
license.workspace = true |
| 48 |
edition.workspace = true |
| 49 |
authors.workspace = true |
| 50 |
repository.workspace = true |
| 51 |
|
| 52 |
[package.metadata.docs.rs] |
| 53 |
features = ["all-databases", "_unstable-all-types"] |
| 54 |
rustdoc-args = ["--cfg", "docsrs"] |
| 55 |
|
| 56 |
[features] |
| 57 |
default = ["any", "macros", "migrate", "json"] |
| 58 |
|
| 59 |
derive = ["sqlx-macros/derive"] |
| 60 |
macros = ["derive", "sqlx-macros/macros"] |
| 61 |
migrate = ["sqlx-core/migrate", "sqlx-macros?/migrate", "sqlx-mysql?/migrate", "sqlx-postgres?/migrate", "sqlx-sqlite?/migrate"] |
| 62 |
|
| 63 |
# intended mainly for CI and docs |
| 64 |
all-databases = ["mysql", "sqlite", "postgres", "any"] |
| 65 |
_unstable-all-types = [ |
| 66 |
"bigdecimal", |
| 67 |
"rust_decimal", |
| 68 |
"json", |
| 69 |
"time", |
| 70 |
"chrono", |
| 71 |
"ipnetwork", |
| 72 |
"mac_address", |
| 73 |
"uuid", |
| 74 |
"bit-vec", |
| 75 |
] |
| 76 |
|
| 77 |
# Base runtime features without TLS |
| 78 |
runtime-async-std = ["_rt-async-std", "sqlx-core/_rt-async-std", "sqlx-macros?/_rt-async-std"] |
| 79 |
runtime-tokio = ["_rt-tokio", "sqlx-core/_rt-tokio", "sqlx-macros?/_rt-tokio"] |
| 80 |
|
| 81 |
# TLS features |
| 82 |
tls-native-tls = ["sqlx-core/_tls-native-tls", "sqlx-macros?/_tls-native-tls"] |
| 83 |
tls-rustls = ["tls-rustls-ring"] # For backwards compatibility |
| 84 |
tls-rustls-aws-lc-rs = ["sqlx-core/_tls-rustls-aws-lc-rs", "sqlx-macros?/_tls-rustls-aws-lc-rs"] |
| 85 |
tls-rustls-ring = ["tls-rustls-ring-webpki"] # For backwards compatibility |
| 86 |
tls-rustls-ring-webpki = ["sqlx-core/_tls-rustls-ring-webpki", "sqlx-macros?/_tls-rustls-ring-webpki"] |
| 87 |
tls-rustls-ring-native-roots = ["sqlx-core/_tls-rustls-ring-native-roots", "sqlx-macros?/_tls-rustls-ring-native-roots"] |
| 88 |
|
| 89 |
# No-op feature used by the workflows to compile without TLS enabled. Not meant for general use. |
| 90 |
tls-none = [] |
| 91 |
|
| 92 |
# Legacy Runtime + TLS features |
| 93 |
|
| 94 |
runtime-async-std-native-tls = ["runtime-async-std", "tls-native-tls"] |
| 95 |
runtime-async-std-rustls = ["runtime-async-std", "tls-rustls-ring"] |
| 96 |
|
| 97 |
runtime-tokio-native-tls = ["runtime-tokio", "tls-native-tls"] |
| 98 |
runtime-tokio-rustls = ["runtime-tokio", "tls-rustls-ring"] |
| 99 |
|
| 100 |
# for conditional compilation |
| 101 |
_rt-async-std = [] |
| 102 |
_rt-tokio = [] |
| 103 |
_sqlite = [] |
| 104 |
|
| 105 |
# database |
| 106 |
any = ["sqlx-core/any", "sqlx-mysql?/any", "sqlx-postgres?/any", "sqlx-sqlite?/any"] |
| 107 |
postgres = ["sqlx-postgres", "sqlx-macros?/postgres"] |
| 108 |
mysql = ["sqlx-mysql", "sqlx-macros?/mysql"] |
| 109 |
sqlite = ["_sqlite", "sqlx-sqlite/bundled", "sqlx-macros?/sqlite"] |
| 110 |
sqlite-unbundled = ["_sqlite", "sqlx-sqlite/unbundled", "sqlx-macros?/sqlite-unbundled"] |
| 111 |
|
| 112 |
# types |
| 113 |
json = ["sqlx-macros?/json", "sqlx-mysql?/json", "sqlx-postgres?/json", "sqlx-sqlite?/json"] |
| 114 |
|
| 115 |
bigdecimal = ["sqlx-core/bigdecimal", "sqlx-macros?/bigdecimal", "sqlx-mysql?/bigdecimal", "sqlx-postgres?/bigdecimal"] |
| 116 |
bit-vec = ["sqlx-core/bit-vec", "sqlx-macros?/bit-vec", "sqlx-postgres?/bit-vec"] |
| 117 |
chrono = ["sqlx-core/chrono", "sqlx-macros?/chrono", "sqlx-mysql?/chrono", "sqlx-postgres?/chrono", "sqlx-sqlite?/chrono"] |
| 118 |
ipnetwork = ["sqlx-core/ipnetwork", "sqlx-macros?/ipnetwork", "sqlx-postgres?/ipnetwork"] |
| 119 |
mac_address = ["sqlx-core/mac_address", "sqlx-macros?/mac_address", "sqlx-postgres?/mac_address"] |
| 120 |
rust_decimal = ["sqlx-core/rust_decimal", "sqlx-macros?/rust_decimal", "sqlx-mysql?/rust_decimal", "sqlx-postgres?/rust_decimal"] |
| 121 |
time = ["sqlx-core/time", "sqlx-macros?/time", "sqlx-mysql?/time", "sqlx-postgres?/time", "sqlx-sqlite?/time"] |
| 122 |
uuid = ["sqlx-core/uuid", "sqlx-macros?/uuid", "sqlx-mysql?/uuid", "sqlx-postgres?/uuid", "sqlx-sqlite?/uuid"] |
| 123 |
regexp = ["sqlx-sqlite?/regexp"] |
| 124 |
|
| 125 |
[workspace.dependencies] |
| 126 |
# Core Crates |
| 127 |
sqlx-core = { version = "=0.8.3", path = "sqlx-core" } |
| 128 |
sqlx-macros-core = { version = "=0.8.3", path = "sqlx-macros-core" } |
| 129 |
sqlx-macros = { version = "=0.8.3", path = "sqlx-macros" } |
| 130 |
|
| 131 |
# Driver crates |
| 132 |
sqlx-mysql = { version = "=0.8.3", path = "sqlx-mysql" } |
| 133 |
sqlx-postgres = { version = "=0.8.3", path = "sqlx-postgres" } |
| 134 |
sqlx-sqlite = { version = "=0.8.3", path = "sqlx-sqlite" } |
| 135 |
|
| 136 |
# Facade crate (for reference from sqlx-cli) |
| 137 |
sqlx = { version = "=0.8.3", path = ".", default-features = false } |
| 138 |
|
| 139 |
# Common type integrations shared by multiple driver crates. |
| 140 |
# These are optional unless enabled in a workspace crate. |
| 141 |
bigdecimal = "0.4.0" |
| 142 |
bit-vec = "0.6.3" |
| 143 |
chrono = { version = "0.4.34", default-features = false, features = ["std", "clock"] } |
| 144 |
ipnetwork = "0.20.0" |
| 145 |
mac_address = "1.1.5" |
| 146 |
rust_decimal = { version = "1.26.1", default-features = false, features = ["std"] } |
| 147 |
time = { version = "0.3.36", features = ["formatting", "parsing", "macros"] } |
| 148 |
uuid = "1.1.2" |
| 149 |
|
| 150 |
# Common utility crates |
| 151 |
dotenvy = { version = "0.15.0", default-features = false } |
| 152 |
|
| 153 |
# Runtimes |
| 154 |
[workspace.dependencies.async-std] |
| 155 |
version = "1.12" |
| 156 |
|
| 157 |
[workspace.dependencies.tokio] |
| 158 |
version = "1" |
| 159 |
features = ["time", "net", "sync", "fs", "io-util", "rt"] |
| 160 |
default-features = false |
| 161 |
|
| 162 |
[dependencies] |
| 163 |
sqlx-core = { workspace = true, features = ["offline", "migrate"] } |
| 164 |
sqlx-macros = { workspace = true, optional = true } |
| 165 |
|
| 166 |
sqlx-mysql = { workspace = true, optional = true } |
| 167 |
sqlx-postgres = { workspace = true, optional = true } |
| 168 |
sqlx-sqlite = { workspace = true, optional = true } |
| 169 |
|
| 170 |
[dev-dependencies] |
| 171 |
anyhow = "1.0.52" |
| 172 |
time_ = { version = "0.3.2", package = "time" } |
| 173 |
futures = "0.3.19" |
| 174 |
env_logger = "0.11" |
| 175 |
async-std = { workspace = true, features = ["attributes"] } |
| 176 |
tokio = { version = "1.15.0", features = ["full"] } |
| 177 |
dotenvy = "0.15.0" |
| 178 |
trybuild = "1.0.53" |
| 179 |
sqlx-test = { path = "./sqlx-test" } |
| 180 |
paste = "1.0.6" |
| 181 |
serde = { version = "1.0.132", features = ["derive"] } |
| 182 |
serde_json = "1.0.73" |
| 183 |
url = "2.2.2" |
| 184 |
rand = "0.8.4" |
| 185 |
rand_xoshiro = "0.6.0" |
| 186 |
hex = "0.4.3" |
| 187 |
tempfile = "3.10.1" |
| 188 |
criterion = { version = "0.5.1", features = ["async_tokio"] } |
| 189 |
|
| 190 |
# If this is an unconditional dev-dependency then Cargo will *always* try to build `libsqlite3-sys`, |
| 191 |
# even when SQLite isn't the intended test target, and fail if the build environment is not set up for compiling C code. |
| 192 |
[target.'cfg(sqlite_test_sqlcipher)'.dev-dependencies] |
| 193 |
# Enable testing with SQLCipher if specifically requested. |
| 194 |
libsqlite3-sys = { version = "0.30.1", features = ["bundled-sqlcipher"] } |
| 195 |
|
| 196 |
# Common lint settings for the workspace |
| 197 |
[workspace.lints.clippy] |
| 198 |
# https://github.com/launchbadge/sqlx/issues/3440 |
| 199 |
cast_possible_truncation = 'deny' |
| 200 |
cast_possible_wrap = 'deny' |
| 201 |
cast_sign_loss = 'deny' |
| 202 |
# See `clippy.toml` |
| 203 |
disallowed_methods = 'deny' |
| 204 |
|
| 205 |
# |
| 206 |
# Any |
| 207 |
# |
| 208 |
|
| 209 |
[[test]] |
| 210 |
name = "any" |
| 211 |
path = "tests/any/any.rs" |
| 212 |
required-features = ["any"] |
| 213 |
|
| 214 |
[[test]] |
| 215 |
name = "any-pool" |
| 216 |
path = "tests/any/pool.rs" |
| 217 |
required-features = ["any"] |
| 218 |
|
| 219 |
# |
| 220 |
# Migrations |
| 221 |
# |
| 222 |
|
| 223 |
[[test]] |
| 224 |
name = "migrate-macro" |
| 225 |
path = "tests/migrate/macro.rs" |
| 226 |
required-features = ["macros", "migrate"] |
| 227 |
|
| 228 |
# |
| 229 |
# SQLite |
| 230 |
# |
| 231 |
|
| 232 |
[[test]] |
| 233 |
name = "sqlite" |
| 234 |
path = "tests/sqlite/sqlite.rs" |
| 235 |
required-features = ["sqlite"] |
| 236 |
|
| 237 |
[[test]] |
| 238 |
name = "sqlite-any" |
| 239 |
path = "tests/sqlite/any.rs" |
| 240 |
required-features = ["sqlite"] |
| 241 |
|
| 242 |
[[test]] |
| 243 |
name = "sqlite-types" |
| 244 |
path = "tests/sqlite/types.rs" |
| 245 |
required-features = ["sqlite"] |
| 246 |
|
| 247 |
[[test]] |
| 248 |
name = "sqlite-describe" |
| 249 |
path = "tests/sqlite/describe.rs" |
| 250 |
required-features = ["sqlite"] |
| 251 |
|
| 252 |
[[test]] |
| 253 |
name = "sqlite-macros" |
| 254 |
path = "tests/sqlite/macros.rs" |
| 255 |
required-features = ["sqlite", "macros"] |
| 256 |
|
| 257 |
[[test]] |
| 258 |
name = "sqlite-unbundled-macros" |
| 259 |
path = "tests/sqlite/macros.rs" |
| 260 |
required-features = ["sqlite-unbundled", "macros"] |
| 261 |
|
| 262 |
[[test]] |
| 263 |
name = "sqlite-derives" |
| 264 |
path = "tests/sqlite/derives.rs" |
| 265 |
required-features = ["sqlite", "macros"] |
| 266 |
|
| 267 |
[[test]] |
| 268 |
name = "sqlite-error" |
| 269 |
path = "tests/sqlite/error.rs" |
| 270 |
required-features = ["sqlite"] |
| 271 |
|
| 272 |
[[test]] |
| 273 |
name = "sqlite-sqlcipher" |
| 274 |
path = "tests/sqlite/sqlcipher.rs" |
| 275 |
required-features = ["sqlite"] |
| 276 |
|
| 277 |
[[test]] |
| 278 |
name = "sqlite-test-attr" |
| 279 |
path = "tests/sqlite/test-attr.rs" |
| 280 |
required-features = ["sqlite", "macros", "migrate"] |
| 281 |
|
| 282 |
[[test]] |
| 283 |
name = "sqlite-migrate" |
| 284 |
path = "tests/sqlite/migrate.rs" |
| 285 |
required-features = ["sqlite", "macros", "migrate"] |
| 286 |
|
| 287 |
[[test]] |
| 288 |
name = "sqlite-rustsec" |
| 289 |
path = "tests/sqlite/rustsec.rs" |
| 290 |
required-features = ["sqlite"] |
| 291 |
|
| 292 |
[[bench]] |
| 293 |
name = "sqlite-describe" |
| 294 |
path = "benches/sqlite/describe.rs" |
| 295 |
harness = false |
| 296 |
required-features = ["sqlite"] |
| 297 |
|
| 298 |
# |
| 299 |
# MySQL |
| 300 |
# |
| 301 |
|
| 302 |
[[test]] |
| 303 |
name = "mysql" |
| 304 |
path = "tests/mysql/mysql.rs" |
| 305 |
required-features = ["mysql"] |
| 306 |
|
| 307 |
[[test]] |
| 308 |
name = "mysql-types" |
| 309 |
path = "tests/mysql/types.rs" |
| 310 |
required-features = ["mysql"] |
| 311 |
|
| 312 |
[[test]] |
| 313 |
name = "mysql-describe" |
| 314 |
path = "tests/mysql/describe.rs" |
| 315 |
required-features = ["mysql"] |
| 316 |
|
| 317 |
[[test]] |
| 318 |
name = "mysql-derives" |
| 319 |
path = "tests/mysql/derives.rs" |
| 320 |
required-features = ["mysql", "derive"] |
| 321 |
|
| 322 |
[[test]] |
| 323 |
name = "mysql-macros" |
| 324 |
path = "tests/mysql/macros.rs" |
| 325 |
required-features = ["mysql", "macros"] |
| 326 |
|
| 327 |
[[test]] |
| 328 |
name = "mysql-error" |
| 329 |
path = "tests/mysql/error.rs" |
| 330 |
required-features = ["mysql"] |
| 331 |
|
| 332 |
[[test]] |
| 333 |
name = "mysql-test-attr" |
| 334 |
path = "tests/mysql/test-attr.rs" |
| 335 |
required-features = ["mysql", "macros", "migrate"] |
| 336 |
|
| 337 |
[[test]] |
| 338 |
name = "mysql-migrate" |
| 339 |
path = "tests/mysql/migrate.rs" |
| 340 |
required-features = ["mysql", "macros", "migrate"] |
| 341 |
|
| 342 |
[[test]] |
| 343 |
name = "mysql-rustsec" |
| 344 |
path = "tests/mysql/rustsec.rs" |
| 345 |
required-features = ["mysql"] |
| 346 |
|
| 347 |
# |
| 348 |
# PostgreSQL |
| 349 |
# |
| 350 |
|
| 351 |
[[test]] |
| 352 |
name = "postgres" |
| 353 |
path = "tests/postgres/postgres.rs" |
| 354 |
required-features = ["postgres"] |
| 355 |
|
| 356 |
[[test]] |
| 357 |
name = "postgres-types" |
| 358 |
path = "tests/postgres/types.rs" |
| 359 |
required-features = ["postgres"] |
| 360 |
|
| 361 |
[[test]] |
| 362 |
name = "postgres-describe" |
| 363 |
path = "tests/postgres/describe.rs" |
| 364 |
required-features = ["postgres"] |
| 365 |
|
| 366 |
[[test]] |
| 367 |
name = "postgres-macros" |
| 368 |
path = "tests/postgres/macros.rs" |
| 369 |
required-features = ["postgres", "macros"] |
| 370 |
|
| 371 |
[[test]] |
| 372 |
name = "postgres-derives" |
| 373 |
path = "tests/postgres/derives.rs" |
| 374 |
required-features = ["postgres", "macros"] |
| 375 |
|
| 376 |
[[test]] |
| 377 |
name = "postgres-error" |
| 378 |
path = "tests/postgres/error.rs" |
| 379 |
required-features = ["postgres"] |
| 380 |
|
| 381 |
[[test]] |
| 382 |
name = "postgres-test-attr" |
| 383 |
path = "tests/postgres/test-attr.rs" |
| 384 |
required-features = ["postgres", "macros", "migrate"] |
| 385 |
|
| 386 |
[[test]] |
| 387 |
name = "postgres-migrate" |
| 388 |
path = "tests/postgres/migrate.rs" |
| 389 |
required-features = ["postgres", "macros", "migrate"] |
| 390 |
|
| 391 |
|
| 392 |
[[test]] |
| 393 |
name = "postgres-query-builder" |
| 394 |
path = "tests/postgres/query_builder.rs" |
| 395 |
required-features = ["postgres"] |
| 396 |
|
| 397 |
[[test]] |
| 398 |
name = "postgres-rustsec" |
| 399 |
path = "tests/postgres/rustsec.rs" |
| 400 |
required-features = ["postgres", "macros", "migrate"] |