···11-- Add migration script here
22create table if not exists safir (
33- key text not null primary key
33+ key text not null primary key,
44 value text not null
55-)
55+);
66+67create index if not exists idx_key on safir(key);
+1-1
src/cli.rs
···11//! CLI for using the Safir binary
22-use crate::store::SafirMode;
22+use crate::store::config::SafirMode;
33pub use clap::{Parser, Subcommand};
4455/// CLI arguments for running the program
···3131 println!("{key}=\"{value}\"")
3232}
33333434+/// Output key-value pairs with a leading string (e.g. alias or export)
3535+pub fn custom_display(display_cmd: &str, keys: Vec<String>, values: Vec<String>) {
3636+ for (key, value) in keys.iter().zip(values.iter()) {
3737+ println!("{display_cmd} {key}=\"{value}\"");
3838+ }
3939+}
4040+3441/// Loads the store from disk
3542pub fn load_store(path: impl AsRef<Path>) -> HashMap<String, String> {
3643 let contents = std::fs::read_to_string(path.as_ref()).expect("unable to store contents");
···5865/// Create the .safirstore directory in the user HOME
5966pub fn create_safir_workspace() -> PathBuf {
6067 let store_dir = if DEBUG {
6161- ".safirstore_debug"
6868+ ".debug_safirstore"
6269 } else {
6370 ".safirstore"
6471 };