Skip to main content

SubmoduleRepository

Trait SubmoduleRepository 

Source
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§

Source

fn insert(&self, input: &SubmoduleInput) -> Result<SubmoduleRow, StorageError>

Insert a new submodule record. Returns the full row (with generated id and timestamps).

Source

fn update(&self, input: &SubmoduleInput) -> Result<(), StorageError>

Update an existing submodule by its relative_path.

Source

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.

Source

fn delete(&self, relative_path: &str) -> Result<(), StorageError>

Delete a submodule record by its relative_path.

Source

fn list(&self) -> Result<Vec<SubmoduleRow>, StorageError>

List all submodules, sorted by relative_path.

Source

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".

Implementors§