0.5.0
This commit is contained in:
@@ -13,6 +13,8 @@ pub struct KbConfig {
|
||||
pub data: KbDataConfig,
|
||||
/// Solana endpoint configuration.
|
||||
pub solana: KbSolanaConfig,
|
||||
/// Database configuration.
|
||||
pub database: KbDatabaseConfig,
|
||||
}
|
||||
|
||||
impl KbConfig {
|
||||
@@ -489,6 +491,36 @@ impl KbWsEndpointConfig {
|
||||
}
|
||||
}
|
||||
|
||||
/// SQLite configuration.
|
||||
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct KbSqliteDatabaseConfig {
|
||||
/// SQLite database path.
|
||||
pub path: std::string::String,
|
||||
/// Whether the file should be created if missing.
|
||||
pub create_if_missing: bool,
|
||||
/// SQLite busy timeout in milliseconds.
|
||||
pub busy_timeout_ms: u64,
|
||||
/// Maximum pool connections.
|
||||
pub max_connections: u32,
|
||||
/// Whether the schema should be initialized automatically at startup.
|
||||
pub auto_initialize_schema: bool,
|
||||
/// Whether WAL journal mode should be enabled.
|
||||
pub use_wal: bool,
|
||||
}
|
||||
|
||||
/// Database configuration.
|
||||
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct KbDatabaseConfig {
|
||||
/// Whether the database layer is enabled.
|
||||
pub enabled: bool,
|
||||
/// Selected backend.
|
||||
pub backend: crate::KbDatabaseBackend,
|
||||
/// SQLite-specific configuration.
|
||||
pub sqlite: KbSqliteDatabaseConfig,
|
||||
}
|
||||
|
||||
fn kb_workspace_root_dir() -> std::path::PathBuf {
|
||||
let manifest_dir = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR"));
|
||||
match manifest_dir.parent() {
|
||||
|
||||
Reference in New Issue
Block a user