pub struct SelectiveCommit {
pub source_pool: SqlitePool,
pub target_pool: SqlitePool,
pub store: Arc<BranchStore>,
pub workspace_id: Uuid,
}Expand description
Fields§
§source_pool: SqlitePoolThe pool connected to the source branch database.
target_pool: SqlitePoolThe pool connected to the target branch database.
store: Arc<BranchStore>Shared branch registry for commit log recording.
workspace_id: UuidWorkspace identifier used to scope branch registry lookups.
Implementations§
Source§impl SelectiveCommit
impl SelectiveCommit
Sourcepub fn new(
source_pool: SqlitePool,
target_pool: SqlitePool,
store: Arc<BranchStore>,
workspace_id: Uuid,
) -> Self
pub fn new( source_pool: SqlitePool, target_pool: SqlitePool, store: Arc<BranchStore>, workspace_id: Uuid, ) -> Self
Creates a new selective commit executor with pre-opened pools.
Sourcepub async fn from_store(
store: Arc<BranchStore>,
source_id: Uuid,
target_id: Uuid,
workspace_id: Uuid,
) -> BranchResult<Self>
pub async fn from_store( store: Arc<BranchStore>, source_id: Uuid, target_id: Uuid, workspace_id: Uuid, ) -> BranchResult<Self>
Opens a SelectiveCommit from branch metadata (opens pools internally).
Sourcepub async fn commit(&self, cherry: &CherryPick) -> BranchResult<CommitResult>
pub async fn commit(&self, cherry: &CherryPick) -> BranchResult<CommitResult>
Applies a cherry-pick to the target branch within a single transaction.
Steps:
- Validate the selection via
CommitValidator - Open a write transaction on target
- Fetch and upsert selected entities (field-filtered if requested)
- Record a commit log entry
- Return
CommitResult
Sourcepub async fn commit_all(
&self,
source_branch_id: Uuid,
target_branch_id: Uuid,
) -> BranchResult<CommitResult>
pub async fn commit_all( &self, source_branch_id: Uuid, target_branch_id: Uuid, ) -> BranchResult<CommitResult>
Promotes all divergent entities from source_branch_id into target_branch_id.
This is a full merge-commit that uses all entity types.
Auto Trait Implementations§
impl Freeze for SelectiveCommit
impl !RefUnwindSafe for SelectiveCommit
impl Send for SelectiveCommit
impl Sync for SelectiveCommit
impl Unpin for SelectiveCommit
impl UnsafeUnpin for SelectiveCommit
impl !UnwindSafe for SelectiveCommit
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more