fixed database query

This commit is contained in:
pandadev 2024-07-05 13:12:59 +02:00
parent f3834f20c5
commit 4954e374fe
No known key found for this signature in database
GPG key ID: C39629DACB8E762F
2 changed files with 9 additions and 1 deletions

View file

@ -45,8 +45,9 @@ pub fn setup(app: &mut tauri::App) -> Result<(), Box<dyn std::error::Error>> {
.take(16) .take(16)
.map(char::from) .map(char::from)
.collect(); .collect();
sqlx::query("INSERT INTO history (id, content_type, content) VALUES (?, text, ?)") sqlx::query("INSERT INTO history (id, content_type, content) VALUES (?, ?, ?)")
.bind(id) .bind(id)
.bind("text")
.bind("Welcome to your clipboard history!") .bind("Welcome to your clipboard history!")
.execute(&pool) .execute(&pool)
.await .await

View file

@ -35,6 +35,13 @@ fn main() {
window.show().unwrap(); window.show().unwrap();
} }
#[cfg(dev)]
{
let window = app.get_webview_window("main").unwrap();
window.open_devtools();
window.close_devtools();
}
Ok(()) Ok(())
}) })
.on_window_event(|app, event| match event { .on_window_event(|app, event| match event {