Skip to main content

Write

Trait Write 

Source
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§

Source

fn decorate_row(&self, row: Array, metadata: &Array) -> Result<Array>

The row to write.

Source

fn after_create( &self, table: &str, metadata: &Array, context: &Value, ) -> Result<()>

After rows were created.

Source

fn after_update( &self, table: &str, metadata: &Array, context: &Value, ) -> Result<()>

After a row was updated.

Source

fn after_batch_update( &self, table: &str, update_data: &Array, metadata: &Array, context: &Value, ) -> Result<()>

After a batch update.

Source

fn after_delete(&self, table: &str, ids: &Array, context: &Value) -> Result<()>

After rows were deleted.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§