MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / update_program

Method update_program

crates/engine/src/relational_db.rs:471–473  ·  view source on GitHub ↗

Update the module associated with this database. The caller must ensure that: - `program.hash` is the [`Hash`] over `program.bytes`. - `program.bytes` is a valid module acc. to `program.host_type`. - the schema updates contained in the module have been applied within the transactional context `tx`. - the `__init__` reducer contained in the module has been executed within the transactional contex

(&self, tx: &mut MutTx, program: Program)

Source from the content-addressed store, hash-verified

469 /// - the `__init__` reducer contained in the module has been executed
470 /// within the transactional context `tx`.
471 pub fn update_program(&self, tx: &mut MutTx, program: Program) -> Result<(), DBError> {
472 Ok(self.inner.update_program(tx, program)?)
473 }
474
475 fn restore_from_snapshot_or_bootstrap(
476 database_identity: Identity,

Callers 2

try_initMethod · 0.45
update_databaseMethod · 0.45

Calls 1

OkFunction · 0.50

Tested by

no test coverage detected