feat(redis): add local expiration modes
This commit is contained in:
1 parent
3a2dc4225a
commit
51fa058edb
35 files changed
+2918
-98
No files matched your search
@@ -235,6 +235,7 @@ pub async fn redis_stream_add(
|
||||
fields: Vec<(String, String)>,
|
||||
ttl: Option<i64>,
|
||||
) -> Result<(), String> {
|
||||
ensure_connection_writable(&state, &connection_id, "XADD").await?;
|
||||
dbx_core::redis_ops::redis_stream_add_in_db_core(&state, &connection_id, db, &key_raw, &entry_id, fields, ttl).await
|
||||
}
|
||||
|
||||
@@ -247,6 +248,7 @@ pub async fn redis_json_set(
|
||||
value: String,
|
||||
ttl: Option<i64>,
|
||||
) -> Result<(), String> {
|
||||
ensure_connection_writable(&state, &connection_id, "JSON.SET").await?;
|
||||
dbx_core::redis_ops::redis_json_set_in_db_core(&state, &connection_id, db, &key_raw, &value, ttl).await
|
||||
}
|
||||
|
||||
@@ -271,6 +273,18 @@ pub async fn redis_set_ttl(
|
||||
dbx_core::redis_ops::redis_set_ttl_in_db_core(&state, &connection_id, db, &key_raw, ttl).await
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn redis_set_expire_at(
|
||||
state: State<'_, Arc<AppState>>,
|
||||
connection_id: String,
|
||||
db: u32,
|
||||
key_raw: String,
|
||||
expire_at: i64,
|
||||
) -> Result<(), String> {
|
||||
ensure_connection_writable(&state, &connection_id, "EXPIREAT").await?;
|
||||
dbx_core::redis_ops::redis_set_expire_at_in_db_core(&state, &connection_id, db, &key_raw, expire_at).await
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn redis_delete_keys(
|
||||
state: State<'_, Arc<AppState>>,
|
||||
|
||||
Reference in new issue
Block a user