Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for mysql and sqlite #100

Merged
merged 18 commits into from
Sep 28, 2024
Prev Previous commit
Next Next commit
some cleanup
  • Loading branch information
Frank-III committed Sep 27, 2024
commit 33f15142e1ceb8ca0eb485966f2860890d46334f
2 changes: 1 addition & 1 deletion src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ pub struct AppState<'a, DB: Database> {
pub last_query_end: Option<chrono::DateTime<chrono::Utc>>,
}

pub struct Components<'a, DB: sqlx::Database> {
pub struct Components<'a, DB> {
pub menu: Box<dyn MenuComponent<'a, DB>>,
pub editor: Box<dyn Component<DB>>,
pub history: Box<dyn Component<DB>>,
Expand Down
11 changes: 2 additions & 9 deletions src/components/menu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,9 @@ pub trait SettableTableList<'a> {
fn set_table_list(&mut self, data: Option<Result<Rows, DbError>>);
}

pub trait MenuComponent<'a, DB>: Component<DB> + SettableTableList<'a>
where
DB: sqlx::Database,
{
}
pub trait MenuComponent<'a, DB: Database>: Component<DB> + SettableTableList<'a> {}

impl<'a, T, DB> MenuComponent<'a, DB> for T
where
T: Component<DB> + SettableTableList<'a>,
DB: sqlx::Database,
impl<'a, T, DB: Database> MenuComponent<'a, DB> for T where T: Component<DB> + SettableTableList<'a>
{
}

Expand Down