1use sqlx::PgPool;
2use uuid::Uuid;
3use anyhow::Result;
4use crate::models::*;
5
6pub struct Database {
7 pub pool: PgPool,
8}
9
10impl Database {
11 pub fn new(pool: PgPool) -> Self {
12 Self { pool }
13 }
14
15 pub async fn get_test_runs(&self) -> Result<Vec<TestRun>> {
16 Ok(vec![])
19 }
20
21 pub async fn create_test_run(&self, run: &TestRun) -> Result<TestRun> {
22 Ok(run.clone())
25 }
26
27 pub async fn get_test_run_by_id(&self, id: Uuid) -> Result<Option<TestRun>> {
28 Ok(None)
31 }
32
33 pub async fn update_test_run(&self, run: &TestRun) -> Result<TestRun> {
34 Ok(run.clone())
37 }
38
39 pub async fn delete_test_run(&self, id: Uuid) -> Result<bool> {
40 Ok(true)
43 }
44}