use anyhow crate, return id on insert

This commit is contained in:
yggverse 2025-03-07 18:14:37 +02:00
parent e859b97d79
commit 5effd63575
42 changed files with 496 additions and 1164 deletions

View file

@ -1,10 +1,10 @@
pub mod browser;
mod database;
use browser::Browser;
use crate::profile::Profile;
use adw::Application;
use anyhow::Result;
use browser::Browser;
use gtk::{
glib::ExitCode,
prelude::{ActionExt, ApplicationExt, ApplicationExtManual, GtkApplicationExt},
@ -294,11 +294,9 @@ impl App {
}
// Tools
fn migrate(tx: &Transaction) -> Result<(), String> {
fn migrate(tx: &Transaction) -> Result<()> {
// Migrate self components
if let Err(e) = database::init(tx) {
return Err(e.to_string());
}
database::init(tx)?;
// Delegate migration to childs
browser::migrate(tx)?;