drizzle_core/builder.rs
1use crate::{OrderBy, SQL, traits::SQLParam};
2
3/// Marker trait for executable builder states.
4pub trait ExecutableState {}
5
6#[derive(Debug, Clone)]
7pub struct BuilderInit;
8
9impl ExecutableState for BuilderInit {}
10
11/// Represents an ORDER BY clause in a query.
12#[derive(Debug, Clone)]
13pub struct OrderByClause<'a, V: SQLParam> {
14 /// The expression to order by.
15 pub expr: SQL<'a, V>,
16 /// The direction to sort (ASC or DESC).
17 pub direction: OrderBy,
18}
19
20impl<'a, V: SQLParam> OrderByClause<'a, V> {
21 /// Creates a new ORDER BY clause.
22 pub const fn new(expr: SQL<'a, V>, direction: OrderBy) -> Self {
23 Self { expr, direction }
24 }
25}