MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / stamp_schema_version

Function stamp_schema_version

atomic-core/src/pristine/schema.rs:224–233  ·  view source on GitHub ↗

Record the baseline schema unless the database already carries a version.

(txn: &WriteTransaction)

Source from the content-addressed store, hash-verified

222
223/// Record the baseline schema unless the database already carries a version.
224pub(crate) fn stamp_schema_version(txn: &WriteTransaction) -> PristineResult<()> {
225 let mut meta = txn.open_table(ATOMIC_META)?;
226 if meta.get(SCHEMA_VERSION_KEY)?.is_none() {
227 meta.insert(
228 SCHEMA_VERSION_KEY,
229 BASE_SCHEMA_VERSION.to_le_bytes().as_slice(),
230 )?;
231 }
232 Ok(())
233}
234
235/// Raise the schema fence in the same transaction as the projected-semantics
236/// capability. This is monotonic: no operation may downgrade it later.

Calls 5

is_noneMethod · 0.80
to_le_bytesMethod · 0.80
getMethod · 0.65
insertMethod · 0.45
as_sliceMethod · 0.45