Skip to main content

rsiot/components/cmp_surrealdb/
mod.rs

1//! Компонент для взаимодействия с базой данных SurrealDB
2//!
3//! # Настройка баз данных
4//!
5//! ## RocksDB
6//!
7//! Для сборки под Windows поставить через Visual Studio Installer:
8//!
9//! - поставил llvm через choco
10//! - Visual Studio Build Tools:
11//!   - MSVC v143 - VS 2022 C++
12//!   - Windows 11 SDK
13//!   - C++ CMake tools for Windows
14//!
15//! ## TiKV
16//!
17//! https://tikv.org/docs/7.1/deploy/install/test/#deploy-the-tikv-cluster-on-a-single-machine
18//!
19//! ``` sh
20//! wget https://download.pingcap.org/tidb-latest-linux-amd64.tar.gz
21//! wget http://download.pingcap.org/tidb-latest-linux-amd64.sha256
22//!
23//! sha256sum -c tidb-latest-linux-amd64.sha256
24//!
25//! # Extract the package.
26//! tar -xzf tidb-latest-linux-amd64.tar.gz
27//! ```
28
29mod component;
30mod config;
31mod error;
32mod fn_process;
33mod tasks;
34
35pub use component::{COMPONENT_NAME, Cmp};
36pub use config::{Config, ConfigConnection, RequestInputConfig, RequestStartConfig};
37pub use error::Error;
38
39type Result<T> = std::result::Result<T, Error>;
40
41static DB: std::sync::LazyLock<surrealdb::Surreal<surrealdb::engine::any::Any>> =
42    std::sync::LazyLock::new(surrealdb::Surreal::init);