feat(redis): edit hash fields
This commit is contained in:
1 parent
75c2dc5e17
commit
0f9d32e1f5
18 files changed
+470
-14
No files matched your search
@@ -213,6 +213,29 @@ pub async fn redis_hash_del(
|
||||
dbx_core::redis_ops::redis_hash_del_in_db_core(&state, &connection_id, db, &key_raw, &field).await
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn redis_hash_field_update(
|
||||
state: State<'_, Arc<AppState>>,
|
||||
connection_id: String,
|
||||
db: u32,
|
||||
key_raw: String,
|
||||
old_field: String,
|
||||
new_field: String,
|
||||
value: String,
|
||||
) -> Result<(), String> {
|
||||
ensure_connection_writable(&state, &connection_id, "Atomic hash field update").await?;
|
||||
dbx_core::redis_ops::redis_hash_field_update_in_db_core(
|
||||
&state,
|
||||
&connection_id,
|
||||
db,
|
||||
&key_raw,
|
||||
&old_field,
|
||||
&new_field,
|
||||
&value,
|
||||
)
|
||||
.await
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn redis_hash_field_set_ttl(
|
||||
state: State<'_, Arc<AppState>>,
|
||||
|
||||
@@ -2062,6 +2062,7 @@ pub fn run() {
|
||||
commands::redis_cmd::redis_rename_key,
|
||||
commands::redis_cmd::redis_hash_set,
|
||||
commands::redis_cmd::redis_hash_del,
|
||||
commands::redis_cmd::redis_hash_field_update,
|
||||
commands::redis_cmd::redis_hash_field_set_ttl,
|
||||
commands::redis_cmd::redis_hash_field_set_expire_at,
|
||||
commands::redis_cmd::redis_list_push,
|
||||
|
||||
Reference in new issue
Block a user