summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorJulian T. <julian@jtle.dk>2024-04-29 22:25:47 +0200
committerJulian T. <julian@jtle.dk>2024-04-29 22:25:47 +0200
commit22c8553af68c6f5b2c62ba790e06b249ac82ed2a (patch)
tree27f954840087372f315311b4d202c2b20c3526b5 /src/main.rs
parent0b29e9b14607f3226c46f75a20f11abd49c8f4a6 (diff)
Add beginnning ui and database
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs26
1 files changed, 22 insertions, 4 deletions
diff --git a/src/main.rs b/src/main.rs
index e5a8fa2..ad4bd25 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,9 +1,27 @@
-use std::io::Result;
+
+use render::App;
+use sqlx::{self, Connection, SqliteConnection};
+
+use std::error::Error;
mod tui;
+mod render;
+mod model;
+
+
+#[tokio::main]
+async fn main() -> Result<(), Box<dyn Error>> {
+ let mut conn = SqliteConnection::connect("sqlite::memory:").await?;
+ let task = sqlx::query_as::<_, model::Task>("SELECT 'hej' as test")
+ .fetch_one(&mut conn).await?;
+
+ println!("{}", task);
+
+
+ let mut terminal = tui::init()?;
+ let res = App::default().run(&mut terminal);
+ tui::restore()?;
-fn main() -> Result<()> {
- let mut terminal = tui::init();
- tui::restore();
+ res?;
Ok(())
}