mirror of
https://github.com/patarapolw/cjdic2.git
synced 2026-11-08 17:35:18 +00:00
(feat) sql runner for the frontend invoke
This commit is contained in:
1 parent
d6f2b145c3
commit
cbef2046fd
5 files changed
+83
-8
No files matched your search
@@ -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)
|
||||
}
|
||||
Reference in new issue
Block a user