2023-05-09 06:37:07 +00:00
|
|
|
use once_cell::sync::Lazy;
|
|
|
|
|
2022-10-16 22:20:39 +00:00
|
|
|
/// The characters which are supported in server record IDs.
|
2022-02-22 14:16:50 +00:00
|
|
|
pub const ID_CHARS: [char; 36] = [
|
|
|
|
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i',
|
|
|
|
'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
|
|
|
|
];
|
2023-06-09 13:45:07 +00:00
|
|
|
|
|
|
|
/// The publicly visible name of the server
|
|
|
|
pub const SERVER_NAME: &str = "SurrealDB";
|
2023-09-08 15:53:26 +00:00
|
|
|
|
2024-07-17 22:44:05 +00:00
|
|
|
/// Specifies the names of parameters which can not be specified in a query.
|
|
|
|
pub const PROTECTED_PARAM_NAMES: &[&str] = &["access", "auth", "token", "session"];
|
|
|
|
|
|
|
|
/// Specifies how many concurrent jobs can be buffered in the worker channel.
|
|
|
|
#[cfg(not(target_arch = "wasm32"))]
|
|
|
|
pub static MAX_CONCURRENT_TASKS: Lazy<usize> =
|
|
|
|
lazy_env_parse!("SURREAL_MAX_CONCURRENT_TASKS", usize, 64);
|
|
|
|
|
|
|
|
/// Specifies how deep computation recursive call will go before en error is returned.
|
|
|
|
pub static MAX_COMPUTATION_DEPTH: Lazy<u32> =
|
|
|
|
lazy_env_parse!("SURREAL_MAX_COMPUTATION_DEPTH", u32, 120);
|
|
|
|
|
|
|
|
/// Specifies the number of items which can be cached within a single transaction.
|
|
|
|
pub static TRANSACTION_CACHE_SIZE: Lazy<usize> =
|
|
|
|
lazy_env_parse!("SURREAL_TRANSACTION_CACHE_SIZE", usize, 10_000);
|
|
|
|
|
|
|
|
/// The maximum number of keys that should be scanned at once in general queries.
|
|
|
|
pub static NORMAL_FETCH_SIZE: Lazy<u32> = lazy_env_parse!("SURREAL_NORMAL_FETCH_SIZE", u32, 50);
|
|
|
|
|
|
|
|
/// The maximum number of keys that should be scanned at once for export queries.
|
|
|
|
pub static EXPORT_BATCH_SIZE: Lazy<u32> = lazy_env_parse!("SURREAL_EXPORT_BATCH_SIZE", u32, 1000);
|
|
|
|
|
|
|
|
/// The maximum number of keys that should be fetched when streaming range scanns in a Scanner.
|
|
|
|
pub static MAX_STREAM_BATCH_SIZE: Lazy<u32> =
|
|
|
|
lazy_env_parse!("SURREAL_MAX_STREAM_BATCH_SIZE", u32, 1000);
|
2023-11-20 14:54:27 +00:00
|
|
|
|
2024-07-30 14:23:54 +00:00
|
|
|
/// Forward all signup/signin/authenticate query errors to a client performing authentication. Do not use in production.
|
|
|
|
pub static INSECURE_FORWARD_ACCESS_ERRORS: Lazy<bool> =
|
|
|
|
lazy_env_parse!("SURREAL_INSECURE_FORWARD_ACCESS_ERRORS", bool, false);
|
2024-03-28 16:29:55 +00:00
|
|
|
|
|
|
|
#[cfg(any(
|
2024-05-23 13:04:20 +00:00
|
|
|
feature = "kv-mem",
|
2024-03-28 16:29:55 +00:00
|
|
|
feature = "kv-surrealkv",
|
|
|
|
feature = "kv-rocksdb",
|
|
|
|
feature = "kv-fdb",
|
|
|
|
feature = "kv-tikv",
|
|
|
|
))]
|
|
|
|
/// Specifies the buffer limit for external sorting.
|
|
|
|
/// If the environment variable is not present or cannot be parsed, a default value of 50,000 is used.
|
|
|
|
pub static EXTERNAL_SORTING_BUFFER_LIMIT: Lazy<usize> =
|
|
|
|
lazy_env_parse!("SURREAL_EXTERNAL_SORTING_BUFFER_LIMIT", usize, 50_000);
|