pub trait SubmoduleRepository {
// Required methods
fn insert(
&self,
input: &SubmoduleInput,
) -> Result<SubmoduleRow, StorageError>;
fn update(&self, input: &SubmoduleInput) -> Result<(), StorageError>;
fn upsert(&self, input: &SubmoduleInput) -> Result<(), StorageError>;
fn delete(&self, relative_path: &str) -> Result<(), StorageError>;
fn list(&self) -> Result<Vec<SubmoduleRow>, StorageError>;
fn find_by_path(
&self,
relative_path: &str,
) -> Result<Option<SubmoduleRow>, StorageError>;
}Expand description
Persistence operations for submodule records.
Tracks git submodules linked to a parent project, each with a dedicated DB.
Required Methods§
Sourcefn insert(&self, input: &SubmoduleInput) -> Result<SubmoduleRow, StorageError>
fn insert(&self, input: &SubmoduleInput) -> Result<SubmoduleRow, StorageError>
Insert a new submodule record. Returns the full row (with generated id
and timestamps).
Sourcefn update(&self, input: &SubmoduleInput) -> Result<(), StorageError>
fn update(&self, input: &SubmoduleInput) -> Result<(), StorageError>
Update an existing submodule by its relative_path.
Sourcefn upsert(&self, input: &SubmoduleInput) -> Result<(), StorageError>
fn upsert(&self, input: &SubmoduleInput) -> Result<(), StorageError>
Insert or update a submodule record atomically.
Uses INSERT ... ON CONFLICT(relative_path) DO UPDATE so the caller
doesn’t need a separate try-update-then-insert pattern.
Sourcefn delete(&self, relative_path: &str) -> Result<(), StorageError>
fn delete(&self, relative_path: &str) -> Result<(), StorageError>
Delete a submodule record by its relative_path.
Sourcefn list(&self) -> Result<Vec<SubmoduleRow>, StorageError>
fn list(&self) -> Result<Vec<SubmoduleRow>, StorageError>
List all submodules, sorted by relative_path.
Sourcefn find_by_path(
&self,
relative_path: &str,
) -> Result<Option<SubmoduleRow>, StorageError>
fn find_by_path( &self, relative_path: &str, ) -> Result<Option<SubmoduleRow>, StorageError>
Find a submodule by its mount path relative to the repo root.
Returns None if no record exists for this path.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".