Skip to content

Commit

Permalink
Fix migration 115 to have proper transactionality (#32376)
Browse files Browse the repository at this point in the history
More copy pastable for not-append-only tables. Also less likely
to run into the transaction limit issue or the index retention issue
since it pulls all the IDs into memory on the outer transaction.

GitOrigin-RevId: 9084695dc8a77239c12fcd2518d8afde9686e881
  • Loading branch information
nipunn1313 authored and Convex, Inc. committed Dec 17, 2024
1 parent dd384c0 commit 685eacc
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions crates/database/src/bootstrap_model/system_metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,17 @@ impl<'a, RT: Runtime> SystemMetadataModel<'a, RT> {
self.tx.patch_inner(id, value).await
}

/// Get's the object by ID
#[minitrace::trace]
#[convex_macro::instrument_future]
pub async fn get(
&mut self,
id: ResolvedDocumentId,
) -> anyhow::Result<Option<ResolvedDocument>> {
anyhow::ensure!(self.tx.table_mapping().is_system_tablet(id.tablet_id));
self.tx.get(id).await
}

#[minitrace::trace]
#[convex_macro::instrument_future]
pub async fn replace(
Expand Down

0 comments on commit 685eacc

Please sign in to comment.