sabiql 1.9.1

A fast, driver-less TUI for browsing and editing PostgreSQL databases
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use std::path::PathBuf;

use crate::domain::connection::ServiceEntry;

#[derive(Debug, Clone, thiserror::Error)]
pub enum ServiceFileError {
    #[error("Service file not found: {0}")]
    NotFound(String),
    #[error("Read error: {0}")]
    ReadError(String),
    #[error("Parse error: {0}")]
    ParseError(String),
}

#[cfg_attr(test, mockall::automock)]
pub trait ServiceFileReader: Send + Sync {
    fn read_services(&self) -> Result<(Vec<ServiceEntry>, PathBuf), ServiceFileError>;
}