Skip to content

Rust core ​

dbpinball-core is the headless domain. It has no Tauri, no CLI parser and no terminal I/O.

Modules ​

ModuleResponsibility
domain::connectionDbConnection, DbEngine, TargetClass
domain::errorCoreError, ErrorCode, redaction
store::connection_storeThe versioned store, mutations, import, migration status
store::lockCross-process lock and stale recovery
store::pathsThe shared configuration directory
store::recordStoreFile, ImportReport, InvalidRecord, ConflictRecord
adapters::keyringKeyringCredentialProvider
ports::credentialsThe CredentialProvider trait and Secret
services::inspectConnection test, database and table listing

The connection model ​

rust
pub struct DbConnection {
    pub id: String,
    pub name: String,
    pub engine: DbEngine,
    pub host: String,
    pub port: u16,
    pub database: String,
    pub username: String,
    pub use_ssl: bool,
    pub target: TargetClass,
}

target is a user hint (production, staging, local, unknown). It is metadata, not proof, and it is never used on its own to decide that a database is safe to write to.

Error model ​

CoreError carries a stable ErrorCode and a message. Every message passes through redact, which removes user:password@ from URL-shaped text. The CLI maps the code to a documented exit code; the desktop maps it to a safe message.

Credential port ​

The core does not know how a password is stored. It depends on the CredentialProvider trait:

rust
pub trait CredentialProvider: Send + Sync {
    fn get(&self, connection_id: &str) -> Result<Secret, CoreError>;
    fn set(&self, connection_id: &str, secret: &Secret) -> Result<(), CoreError>;
    fn delete(&self, connection_id: &str) -> Result<(), CoreError>;
}

The keyring adapter implements it for the desktop and the CLI. The CLI also has an environment adapter that can only read.

Released under the MIT License.