aboutsummaryrefslogtreecommitdiffstats
path: root/src/database.rs
blob: 1b003773119364e94a5acbbbcdffd46214d3a6b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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(())
    }
}