migration to sqlite!

This commit is contained in:
lda
2026-04-26 04:18:33 +07:00 Verified
parent 1a3a45cde2
commit 65a0891308
12 changed files with 1612 additions and 400 deletions
+1 -1
View File
@@ -40,7 +40,7 @@ pub fn write_init_config(args: &InitConfigArgs) -> Result<Option<PathBuf>> {
let state_file_raw = args
.state_file
.clone()
.unwrap_or_else(|| PathBuf::from("state.db"));
.unwrap_or_else(|| PathBuf::from("state.sqlite3"));
let state_file = resolve_path(&data_dir, state_file_raw);
let pid_file_raw = args
+7 -4
View File
@@ -49,7 +49,7 @@ impl DaemonConfig {
.state_file
.clone()
.or(file.state_file)
.unwrap_or_else(|| PathBuf::from("state.db"));
.unwrap_or_else(|| PathBuf::from("state.sqlite3"));
let state_file = resolve_path(&data_dir, state_file_raw);
let command_timeout = Duration::from_millis(
@@ -255,7 +255,7 @@ fn resolve_state_access(
&data_dir,
cli_state_file
.or(file.state_file)
.unwrap_or_else(|| PathBuf::from("state.db")),
.unwrap_or_else(|| PathBuf::from("state.sqlite3")),
);
let resolved_public_url = cli_public_url
@@ -288,8 +288,11 @@ mod tests {
fn resolve_path_joins_relative_path() {
let out = resolve_path(
Path::new("/var/lib/wakey-control-plane"),
PathBuf::from("state.db"),
PathBuf::from("state.sqlite3"),
);
assert_eq!(
out,
PathBuf::from("/var/lib/wakey-control-plane/state.sqlite3")
);
assert_eq!(out, PathBuf::from("/var/lib/wakey-control-plane/state.db"));
}
}