Skip to content

A simple key-value store designed to be used from shell scripts written in rust. ๐Ÿš€

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE.txt
MIT
LICENSE-MIT.txt
Notifications You must be signed in to change notification settings

DOD-101/config-store

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

29 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Config-Store

Static Badge Dynamic TOML Badge

Config-Store is a simple key-value store designed to be used from shell scripts.

Example

Say, for example, you have a keybinding that switches between two applications. For this, you will probably need to save what app you are currently in.

Now you could create an entry with the set command and then toggle between the states with toggle

Usage

config-store --help or see doc comments in ./src/commands.rs

Config-store has shell completions. Simply add eval "$(config-store completions *your_shell*)" to your shell config.

Note on /tmp

Most distros will clear /tmp on boot. You should check what the case is for your distro and write your scripts accordingly, or change /tmp to clear on boot.

On NixOS this can be done by setting boot.tmp.cleanOnBoot = true;.

Installing

Simply run cargo install.

config-store is also availabe in nixpkgs.

Technical details

  • The data (aka the key-value pairs) are stored in /tmp/config-store.db, which is a sqlite3 database.

  • Internally, the commands are mostly wrappers around SQL statements.

  • While it is technically possible to have multiple different entries with the same name, because the primary key is not the name. This is impossible to do with the commands provided, since set will always update a value if it exists.

  • Because the data is stored on disk, config-store needs no server process. Not only does this make it simpler, it also means there is no overhead to using it to store your variables.

License

This project is licensed under either of

at your option.

About

A simple key-value store designed to be used from shell scripts written in rust. ๐Ÿš€

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE.txt
MIT
LICENSE-MIT.txt

Stars

Watchers

Forks

Packages

No packages published

Languages