icydb-core 0.93.0

IcyDB — A schema-first typed query engine and persistence runtime for Internet Computer canisters
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::db::{
    query::intent::StructuralQuery,
    sql::parser::{SqlOrderDirection, SqlOrderTerm},
};

pub(super) fn apply_order_terms_structural(
    mut query: StructuralQuery,
    order_by: Vec<SqlOrderTerm>,
) -> StructuralQuery {
    for term in order_by {
        query = match term.direction {
            SqlOrderDirection::Asc => query.order_by(term.field),
            SqlOrderDirection::Desc => query.order_by_desc(term.field),
        };
    }

    query
}