MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / replace_schema

Method replace_schema

nodedb-array/src/sync/schema_crdt.rs:173–181  ·  view source on GitHub ↗

Replace the stored schema with `schema`. Re-encodes the schema as MessagePack and overwrites `root["content"]`. Bumps `schema_hlc` via `generator.next()`. This is the stub entry point for Phase F ALTER ARRAY support. Incremental dim/attr add will build on this path.

(
        &mut self,
        schema: &ArraySchema,
        generator: &HlcGenerator,
    )

Source from the content-addressed store, hash-verified

171 /// This is the stub entry point for Phase F ALTER ARRAY support.
172 /// Incremental dim/attr add will build on this path.
173 pub fn replace_schema(
174 &mut self,
175 schema: &ArraySchema,
176 generator: &HlcGenerator,
177 ) -> ArrayResult<()> {
178 self.write_schema_to_doc(schema)?;
179 self.schema_hlc = generator.next()?;
180 Ok(())
181 }
182
183 // ─── Internal helpers ────────────────────────────────────────────────────
184

Callers 2

replace_schema_bumps_hlcFunction · 0.80

Calls 2

write_schema_to_docMethod · 0.80
nextMethod · 0.45

Tested by 2

replace_schema_bumps_hlcFunction · 0.64