zeph 0.20.1

Lightweight AI agent with hybrid inference, skills-first architecture, and multi-channel I/O
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// SPDX-FileCopyrightText: 2026 Andrei G <bug-ops>
// SPDX-License-Identifier: MIT OR Apache-2.0

/// Returns the effective database URL for the current build.
///
/// Prefers `database_url` when set and non-empty (postgres backend), otherwise falls
/// back to `sqlite_path` (sqlite backend). Mirrors the logic in `AppBuilder::build_memory`.
pub(crate) fn resolve_db_url(config: &zeph_core::config::Config) -> &str {
    config
        .memory
        .database_url
        .as_deref()
        .filter(|s| !s.is_empty())
        .unwrap_or(&config.memory.sqlite_path)
}