pub trait Write: Send + Sync {
// Required methods
fn decorate_row(&self, row: Array, metadata: &Array) -> Result<Array>;
fn after_create(
&self,
table: &str,
metadata: &Array,
context: &Value,
) -> Result<()>;
fn after_update(
&self,
table: &str,
metadata: &Array,
context: &Value,
) -> Result<()>;
fn after_batch_update(
&self,
table: &str,
update_data: &Array,
metadata: &Array,
context: &Value,
) -> Result<()>;
fn after_delete(
&self,
table: &str,
ids: &Array,
context: &Value,
) -> Result<()>;
}Expand description
Decorates rows before they are written and observes writes, for the database layer.
PHP: Utopia\Query\Hook\Write.
Required Methods§
Sourcefn after_create(
&self,
table: &str,
metadata: &Array,
context: &Value,
) -> Result<()>
fn after_create( &self, table: &str, metadata: &Array, context: &Value, ) -> Result<()>
After rows were created.
Sourcefn after_update(
&self,
table: &str,
metadata: &Array,
context: &Value,
) -> Result<()>
fn after_update( &self, table: &str, metadata: &Array, context: &Value, ) -> Result<()>
After a row was updated.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".