commit_bridge/repository/
branch.rs1use crate::model::Branch;
4use crate::repository::RepositoryError;
5use async_trait::async_trait;
6
7#[async_trait]
9pub trait BranchRepository: Send + Sync {
10 async fn get_all(&self) -> Result<Vec<Branch>, RepositoryError>;
12
13 async fn find_by_id(&self, id: i64) -> Result<Option<Branch>, RepositoryError>;
15
16 async fn delete_by_id(&self, id: i64) -> Result<(), RepositoryError>;
18
19 async fn update_last_commit_hash(
21 &self,
22 id: i64,
23 hash: &crate::domain::CommitHash,
24 ) -> Result<(), RepositoryError>;
25
26 async fn update_last_commit_hash_in_tx(
28 &self,
29 id: i64,
30 hash: &crate::domain::CommitHash,
31 tx: &mut sqlx::SqliteConnection,
32 ) -> Result<(), RepositoryError>;
33}