Tauri History Command Handlers (commands/history.rs)

dbx · src-tauri/src/commands/history.rs · rust · Apache-2.0
database, infra, lang:rust, fw:tauri, tag:history

Provides Tauri IPC commands for saving, loading, and searching application history entries. Reuse in desktop database clients.

// Source: https://github.com/t8y2/dbx | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
use std::sync::Arc;
use tauri::State;

use super::connection::AppState;
pub use dbx_core::history::{HistoryConnectionOption, HistoryEntry, HistorySearchRequest, HistorySearchResult};

#[tauri::command]
pub async fn save_history(state: State<'_, Arc<AppState>>, entry: HistoryEntry) -> Result<(), String> {
    state.storage.save_history_entry(&entry).await
}

#[tauri::command]
pub async fn load_history(
    state: State<'_, Arc<AppState>>,
    limit: usize,
    offset: usize,
    activity_kind: Option<String>,
) -> Result<Vec<HistoryEntry>, String> {
    state.storage.load_history_entries(limit, o

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key