MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / insert_id_allocator

Method insert_id_allocator

src/catalog/src/durable/transaction.rs:1041–1054  ·  view source on GitHub ↗
(
        &mut self,
        name: String,
        next_id: u64,
    )

Source from the content-addressed store, hash-verified

1039 }
1040
1041 pub(crate) fn insert_id_allocator(
1042 &mut self,
1043 name: String,
1044 next_id: u64,
1045 ) -> Result<(), CatalogError> {
1046 match self.id_allocator.insert(
1047 IdAllocKey { name: name.clone() },
1048 IdAllocValue { next_id },
1049 self.op_id,
1050 ) {
1051 Ok(_) => Ok(()),
1052 Err(_) => Err(SqlCatalogError::IdAllocatorAlreadyExists(name).into()),
1053 }
1054 }
1055
1056 /// Removes the database `id` from the transaction.
1057 ///

Callers 1

initializeFunction · 0.80

Calls 2

insertMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected