mirror of
https://github.com/launchbadge/sqlx.git
synced 2025-11-12 11:24:44 +00:00
fix: expose runtime-actix in sqlx/Cargo.toml
This commit is contained in:
parent
884b523d43
commit
a3053119fa
@ -38,7 +38,10 @@ rustdoc-args = ["--cfg", "docsrs"]
|
|||||||
[features]
|
[features]
|
||||||
default = [ "macros", "runtime-async-std" ]
|
default = [ "macros", "runtime-async-std" ]
|
||||||
macros = [ "sqlx-macros" ]
|
macros = [ "sqlx-macros" ]
|
||||||
tls = [ "sqlx-core/tls" ]
|
|
||||||
|
# [deprecated] TLS is not possible to disable due to it being conditional on multiple features
|
||||||
|
# Hopefully Cargo can handle this in the future
|
||||||
|
tls = [ ]
|
||||||
|
|
||||||
# offline building support in `sqlx-macros`
|
# offline building support in `sqlx-macros`
|
||||||
offline = ["sqlx-macros/offline", "sqlx-core/offline"]
|
offline = ["sqlx-macros/offline", "sqlx-core/offline"]
|
||||||
@ -50,6 +53,7 @@ all-types = [ "bigdecimal", "json", "time", "chrono", "ipnetwork", "uuid" ]
|
|||||||
|
|
||||||
# runtime
|
# runtime
|
||||||
runtime-async-std = [ "sqlx-core/runtime-async-std", "sqlx-macros/runtime-async-std" ]
|
runtime-async-std = [ "sqlx-core/runtime-async-std", "sqlx-macros/runtime-async-std" ]
|
||||||
|
runtime-actix = [ "sqlx-core/runtime-actix", "sqlx-macros/runtime-actix" ]
|
||||||
runtime-tokio = [ "sqlx-core/runtime-tokio", "sqlx-macros/runtime-tokio" ]
|
runtime-tokio = [ "sqlx-core/runtime-tokio", "sqlx-macros/runtime-tokio" ]
|
||||||
|
|
||||||
# database
|
# database
|
||||||
|
|||||||
@ -15,10 +15,6 @@ authors = [
|
|||||||
[features]
|
[features]
|
||||||
default = [ "runtime-async-std" ]
|
default = [ "runtime-async-std" ]
|
||||||
|
|
||||||
# [deprecated] TLS is not possible to disable due to it being conditional on multiple features
|
|
||||||
# Hopefully Cargo can handle this in the future
|
|
||||||
tls = []
|
|
||||||
|
|
||||||
# databases
|
# databases
|
||||||
postgres = [ "md-5", "sha2", "base64", "sha-1", "rand", "hmac", "futures-channel/sink", "futures-util/sink" ]
|
postgres = [ "md-5", "sha2", "base64", "sha-1", "rand", "hmac", "futures-channel/sink", "futures-util/sink" ]
|
||||||
mysql = [ "sha-1", "sha2", "generic-array", "num-bigint", "base64", "digest", "rand" ]
|
mysql = [ "sha-1", "sha2", "generic-array", "num-bigint", "base64", "digest", "rand" ]
|
||||||
|
|||||||
@ -18,8 +18,10 @@ proc-macro = true
|
|||||||
[features]
|
[features]
|
||||||
default = [ "runtime-async-std" ]
|
default = [ "runtime-async-std" ]
|
||||||
|
|
||||||
|
# runtimes
|
||||||
runtime-async-std = [ "sqlx-core/runtime-async-std", "async-std" ]
|
runtime-async-std = [ "sqlx-core/runtime-async-std", "async-std" ]
|
||||||
runtime-tokio = [ "sqlx-core/runtime-tokio", "tokio", "once_cell" ]
|
runtime-tokio = [ "sqlx-core/runtime-tokio", "tokio", "once_cell" ]
|
||||||
|
runtime-actix = [ "sqlx-core/runtime-actix", "tokio", "once_cell" ]
|
||||||
|
|
||||||
# offline building support
|
# offline building support
|
||||||
offline = ["sqlx-core/offline", "serde", "serde_json", "hex", "sha2"]
|
offline = ["sqlx-core/offline", "serde", "serde_json", "hex", "sha2"]
|
||||||
|
|||||||
@ -1,13 +1,9 @@
|
|||||||
#[cfg(not(any(feature = "runtime-tokio", feature = "runtime-async-std")))]
|
// NOTE: this is separate from sqlx-rt because of the non-production nature of it
|
||||||
compile_error!("one of 'runtime-async-std' or 'runtime-tokio' features must be enabled");
|
|
||||||
|
|
||||||
#[cfg(all(feature = "runtime-tokio", feature = "runtime-async-std"))]
|
|
||||||
compile_error!("only one of 'runtime-async-std' or 'runtime-tokio' features must be enabled");
|
|
||||||
|
|
||||||
#[cfg(feature = "runtime-async-std")]
|
#[cfg(feature = "runtime-async-std")]
|
||||||
pub(crate) use async_std::task::block_on;
|
pub(crate) use async_std::task::block_on;
|
||||||
|
|
||||||
#[cfg(feature = "runtime-tokio")]
|
#[cfg(any(feature = "runtime-tokio", feature = "runtime-actix"))]
|
||||||
pub fn block_on<F: std::future::Future>(future: F) -> F::Output {
|
pub fn block_on<F: std::future::Future>(future: F) -> F::Output {
|
||||||
use once_cell::sync::Lazy;
|
use once_cell::sync::Lazy;
|
||||||
use tokio::runtime::{self, Runtime};
|
use tokio::runtime::{self, Runtime};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user