feat(redis): add bulk operations and command runner

This commit is contained in:
t8y2 committed 2026-05-12 13:38:43 +08:00
1 parent f2e8b49df7
commit 368fa5a102
17 files changed
+673 -20

No files matched your search

+16 -1
View File
@@ -2,7 +2,7 @@ use std::sync::Arc;
use tauri::State;
use crate::commands::connection::AppState;
use dbx_core::db::redis_driver::{RedisScanResult, RedisValue};
use dbx_core::db::redis_driver::{RedisCommandResult, RedisScanResult, RedisValue};
#[tauri::command]
pub async fn redis_list_databases(state: State<'_, Arc<AppState>>, connection_id: String) -> Result<Vec<u32>, String> {
@@ -164,6 +164,21 @@ pub async fn redis_delete_keys(
dbx_core::redis_ops::redis_delete_keys_in_db_core(&state, &connection_id, db, &key_raws).await
}
#[tauri::command]
pub async fn redis_flush_db(state: State<'_, Arc<AppState>>, connection_id: String, db: u32) -> Result<(), String> {
dbx_core::redis_ops::redis_flush_db_core(&state, &connection_id, db).await
}
#[tauri::command]
pub async fn redis_execute_command(
state: State<'_, Arc<AppState>>,
connection_id: String,
db: u32,
command: String,
) -> Result<RedisCommandResult, String> {
dbx_core::redis_ops::redis_execute_command_core(&state, &connection_id, db, &command).await
}
#[tauri::command]
pub async fn redis_load_more(
state: State<'_, Arc<AppState>>,
+2
View File
@@ -120,6 +120,8 @@ pub fn run() {
commands::redis_cmd::redis_zrem,
commands::redis_cmd::redis_set_ttl,
commands::redis_cmd::redis_delete_keys,
commands::redis_cmd::redis_flush_db,
commands::redis_cmd::redis_execute_command,
commands::redis_cmd::redis_load_more,
commands::saved_sql::load_saved_sql_library,
commands::saved_sql::save_saved_sql_folder,