(feat) sql runner for the frontend invoke

This commit is contained in:
polv committed 2026-03-03 14:02:53 +07:00
1 parent d6f2b145c3
commit cbef2046fd
5 files changed
+83 -8

No files matched your search

+10 -1
View File
@@ -1,6 +1,6 @@
use std::{borrow::Cow, path::PathBuf};
use cjdic2_core::{AppService, CJDicError, YomitanRow, ZipSource};
use cjdic2_core::{AppService, CJDicError, SqlParam, YomitanRow, ZipSource};
use tauri::{AppHandle, Emitter, Manager, Runtime, path::BaseDirectory};
use tauri_plugin_fs::FsExt;
@@ -104,3 +104,12 @@ pub async fn search_yomitan(
) -> Result<Vec<YomitanRow>, CJDicError> {
state.search_yomitan(q_term, q_reading, limit, offset)
}
#[tauri::command]
pub async fn execute_sql(
sql: String,
params: Vec<SqlParam>,
state: tauri::State<'_, AppService>,
) -> Result<serde_json::Value, CJDicError> {
state.execute_sql(sql, params)
}