feat(redis): view and edit Hash field expiry (HEXPIRE/HTTL/HPERSIST)

This commit is contained in:
二丫讲梵 authored and GitHub committed 2026-08-07 02:41:04 +08:00
1 parent f8b2924f42
commit 59187f2e41
12 files changed
+583 -16

No files matched your search

+34
View File
@@ -201,6 +201,40 @@ 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_set_ttl(
state: State<'_, Arc<AppState>>,
connection_id: String,
db: u32,
key_raw: String,
field: String,
ttl: i64,
) -> Result<(), String> {
ensure_connection_writable(&state, &connection_id, "HEXPIRE").await?;
dbx_core::redis_ops::redis_hash_field_set_ttl_in_db_core(&state, &connection_id, db, &key_raw, &field, ttl).await
}
#[tauri::command]
pub async fn redis_hash_field_set_expire_at(
state: State<'_, Arc<AppState>>,
connection_id: String,
db: u32,
key_raw: String,
field: String,
expire_at: i64,
) -> Result<(), String> {
ensure_connection_writable(&state, &connection_id, "HEXPIREAT").await?;
dbx_core::redis_ops::redis_hash_field_set_expire_at_in_db_core(
&state,
&connection_id,
db,
&key_raw,
&field,
expire_at,
)
.await
}
#[tauri::command]
pub async fn redis_list_push(
state: State<'_, Arc<AppState>>,