Skip to content

Commit

Permalink
chore: refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
opeolluwa committed Aug 28, 2023
1 parent 4f2412e commit c86f717
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 3 deletions.
9 changes: 8 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
{
"cSpell.words": ["sqlx"]
"cSpell.words": [
"sqlx"
],
"workbench.colorCustomizations": {
"activityBar.background": "#462511",
"titleBar.activeBackground": "#613417",
"titleBar.activeForeground": "#FDFAF8"
}
}
40 changes: 40 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions src/commands/store.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use crate::database::StoreModel;
use crate::{database::StoreModel, style::PrintColoredText};
use clap::{Args, Subcommand};
use serde::{Deserialize, Serialize};
// let id = Uuid::new_v4();

#[derive(Args, Debug, Serialize)]
pub struct StoreCommands {
Expand Down Expand Up @@ -41,6 +40,8 @@ impl StoreCommands {
/*store the key value pair in the database after checking that the key does not exist, if the key exist prompt use to overwrite */
async fn add(key: &str, value: &str) {
StoreModel::new(key, value).save().await.unwrap();
let message = format!("{key} successfully stored");
PrintColoredText::success(&message);
}
/* accept a key and update the value of the key */
fn set(key: &str, value: &str) {
Expand Down

0 comments on commit c86f717

Please sign in to comment.