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

Function stamp_schema_version

atomic-core/src/pristine/schema.rs:221–230  ·  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

219
220/// Record the baseline schema unless the database already carries a version.
221pub(crate) fn stamp_schema_version(txn: &WriteTransaction) -> PristineResult<()> {
222 let mut meta = txn.open_table(ATOMIC_META)?;
223 if meta.get(SCHEMA_VERSION_KEY)?.is_none() {
224 meta.insert(
225 SCHEMA_VERSION_KEY,
226 BASE_SCHEMA_VERSION.to_le_bytes().as_slice(),
227 )?;
228 }
229 Ok(())
230}
231
232/// Raise the schema fence in the same transaction as the projected-semantics
233/// 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