1use std::error::Error;
2
3use crate::SettingRow;
4
5#[derive(Debug, Clone, Copy, PartialEq, Eq)]
7pub struct SettingsQuery<'a> {
8 pub table: &'a str,
9 pub key_column: &'a str,
10 pub value_column: &'a str,
11 pub order_by: &'a str,
12}
13
14pub trait SettingsStore {
16 fn load_settings(
17 &self,
18 query: &SettingsQuery<'_>,
19 ) -> Result<Vec<SettingRow>, Box<dyn Error + Send + Sync>>;
20
21 fn update_setting(
22 &self,
23 query: &SettingsQuery<'_>,
24 key: &str,
25 value: &str,
26 ) -> Result<(), Box<dyn Error + Send + Sync>>;
27}