aboutsummaryrefslogtreecommitdiffstats
path: root/src/database.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/database.rs')
-rw-r--r--src/database.rs37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/database.rs b/src/database.rs
new file mode 100644
index 0000000..1b00377
--- /dev/null
+++ b/src/database.rs
@@ -0,0 +1,37 @@
+use sqlx::{self, Connection};
+
+use crate::github::Repo;
+
+
+pub struct Db {
+ connection: sqlx::SqliteConnection,
+}
+
+impl Db {
+ pub async fn connect(
+ path: &str,
+ ) -> Result<Self, Box<dyn std::error::Error>> {
+ Ok(
+ Db {
+ connection: sqlx::SqliteConnection::connect(path)
+ .await?,
+ }
+ )
+ }
+
+ pub fn create() -> Result<(), Box<dyn std::error::Error>> {
+ Ok(())
+ }
+
+ pub fn repo_insert(repo: &Repo) -> Result<(), Box<dyn std::error::Error>> {
+ Ok(())
+ }
+
+ pub fn repo_is_updated() -> Result<bool, Box<dyn std::error::Error>> {
+ Ok(false)
+ }
+
+ pub fn repo_update(repo: &Repo) -> Result<(), Box<dyn std::error::Error>> {
+ Ok(())
+ }
+}