use surrealdb::{Surreal, Connection, Result}; use crate::models::mutations::{{ response_type }}; pub async fn mutate_{{ file_name }}( db: &'_ Surreal{%- for variable in variables -%}, {{ variable.name }}: {{ variable.type_ }} {%- endfor %} ) -> Result<{{ response_type }}> { const QUERY: &str = include_str!("../../../mutations/{{ file_name }}.surql"); let result: {{ response_type }} = db .query(QUERY) {%- for variable in variables %} .bind(("{{ variable.name }}", {{ variable.name }})) {%- endfor %} .await? .take(0)?; Ok(result) }