DatabaseHandler

Trait DatabaseHandler 

Source
pub trait DatabaseHandler {
    // Required methods
    fn query(
        &self,
        query: &str,
        params: Option<&JsonnetValue>,
    ) -> Result<JsonnetValue, JsonnetError>;
    fn rewrite(
        &self,
        rule: &str,
        params: Option<&JsonnetValue>,
    ) -> Result<JsonnetValue, JsonnetError>;
    fn patch(&self, patch: &JsonnetValue) -> Result<JsonnetValue, JsonnetError>;
}
Expand description

Database handler trait for external database operations

Required Methods§

Source

fn query( &self, query: &str, params: Option<&JsonnetValue>, ) -> Result<JsonnetValue, JsonnetError>

Execute a GQL query and return results

Source

fn rewrite( &self, rule: &str, params: Option<&JsonnetValue>, ) -> Result<JsonnetValue, JsonnetError>

Execute a graph rewrite rule

Source

fn patch(&self, patch: &JsonnetValue) -> Result<JsonnetValue, JsonnetError>

Apply a patch to the graph

Implementors§