2022-09-28 19:13:40 +00:00
|
|
|
use once_cell::sync::Lazy;
|
2023-07-03 20:23:18 +00:00
|
|
|
#[cfg(any(
|
|
|
|
feature = "storage-mem",
|
|
|
|
feature = "storage-tikv",
|
|
|
|
feature = "storage-rocksdb",
|
|
|
|
feature = "storage-speedb",
|
|
|
|
feature = "storage-fdb",
|
|
|
|
))]
|
2022-10-19 13:56:43 +00:00
|
|
|
use std::time::Duration;
|
2022-09-28 19:13:40 +00:00
|
|
|
|
2022-06-24 15:33:12 +00:00
|
|
|
pub const LOGO: &str = "
|
|
|
|
.d8888b. 888 8888888b. 888888b.
|
|
|
|
d88P Y88b 888 888 'Y88b 888 '88b
|
|
|
|
Y88b. 888 888 888 888 .88P
|
|
|
|
'Y888b. 888 888 888d888 888d888 .d88b. 8888b. 888 888 888 8888888K.
|
|
|
|
'Y88b. 888 888 888P' 888P' d8P Y8b '88b 888 888 888 888 'Y88b
|
|
|
|
'888 888 888 888 888 88888888 .d888888 888 888 888 888 888
|
|
|
|
Y88b d88P Y88b 888 888 888 Y8b. 888 888 888 888 .d88P 888 d88P
|
|
|
|
'Y8888P' 'Y88888 888 888 'Y8888 'Y888888 888 8888888P' 8888888P'
|
|
|
|
|
|
|
|
";
|
|
|
|
|
2022-10-27 08:58:08 +00:00
|
|
|
/// The publicly visible name of the server
|
2023-07-03 20:23:18 +00:00
|
|
|
#[cfg(any(
|
|
|
|
feature = "storage-mem",
|
|
|
|
feature = "storage-tikv",
|
|
|
|
feature = "storage-rocksdb",
|
|
|
|
feature = "storage-speedb",
|
|
|
|
feature = "storage-fdb",
|
|
|
|
))]
|
2022-10-27 08:58:08 +00:00
|
|
|
pub const PKG_NAME: &str = "surrealdb";
|
|
|
|
|
2022-12-20 10:30:06 +00:00
|
|
|
/// The publicly visible user-agent of the command-line tool
|
|
|
|
pub const SERVER_AGENT: &str = concat!("SurrealDB ", env!("CARGO_PKG_VERSION"));
|
|
|
|
|
2022-10-16 22:20:39 +00:00
|
|
|
/// The public endpoint for the administration interface
|
2023-07-03 20:23:18 +00:00
|
|
|
#[cfg(any(
|
|
|
|
feature = "storage-mem",
|
|
|
|
feature = "storage-tikv",
|
|
|
|
feature = "storage-rocksdb",
|
|
|
|
feature = "storage-speedb",
|
|
|
|
feature = "storage-fdb",
|
|
|
|
))]
|
2022-10-16 22:20:39 +00:00
|
|
|
pub const APP_ENDPOINT: &str = "https://surrealdb.com/app";
|
|
|
|
|
|
|
|
/// How many concurrent tasks can be handled in a WebSocket
|
2023-07-03 20:23:18 +00:00
|
|
|
#[cfg(any(
|
|
|
|
feature = "storage-mem",
|
|
|
|
feature = "storage-tikv",
|
|
|
|
feature = "storage-rocksdb",
|
|
|
|
feature = "storage-speedb",
|
|
|
|
feature = "storage-fdb",
|
|
|
|
))]
|
2022-10-16 22:20:39 +00:00
|
|
|
pub const MAX_CONCURRENT_CALLS: usize = 24;
|
|
|
|
|
2022-12-20 10:30:06 +00:00
|
|
|
/// Specifies the frequency with which ping messages should be sent to the client
|
2023-07-03 20:23:18 +00:00
|
|
|
#[cfg(any(
|
|
|
|
feature = "storage-mem",
|
|
|
|
feature = "storage-tikv",
|
|
|
|
feature = "storage-rocksdb",
|
|
|
|
feature = "storage-speedb",
|
|
|
|
feature = "storage-fdb",
|
|
|
|
))]
|
2022-10-19 13:56:43 +00:00
|
|
|
pub const WEBSOCKET_PING_FREQUENCY: Duration = Duration::from_secs(5);
|
|
|
|
|
2022-10-16 22:20:39 +00:00
|
|
|
/// The version identifier of this build
|
2022-10-27 08:58:08 +00:00
|
|
|
pub static PKG_VERSION: Lazy<String> = Lazy::new(|| match option_env!("SURREAL_BUILD_METADATA") {
|
2022-09-28 19:13:40 +00:00
|
|
|
Some(metadata) if !metadata.trim().is_empty() => {
|
|
|
|
let version = env!("CARGO_PKG_VERSION");
|
|
|
|
format!("{version}+{metadata}")
|
|
|
|
}
|
|
|
|
_ => env!("CARGO_PKG_VERSION").to_owned(),
|
|
|
|
});
|