toql_core 0.4.2

Library with core functionality for Toql
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! Trait to build UPDATE SQL statements.
use crate::{error::ToqlError, query::field_path::FieldPath, sql_expr::SqlExpr};

/// The trait allows to build the UPDATE SQL statement for nested structs.
///
/// Trait is implemented by the Toql derive for structs that can update.
pub trait TreeUpdate {
    fn update<'a, I>(
        &self,
        descendents: I,
        fields: &std::collections::HashSet<String>, // if empty, all fields can be updated (*)
        roles: &std::collections::HashSet<String>,
        exprs: &mut Vec<SqlExpr>,
    ) -> Result<(), ToqlError>
    where
        I: Iterator<Item = FieldPath<'a>> + Clone;
}