1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
use super::QueryFragment;
use crate::query_builder::QueryId;

/// A helper query node that contains both limit and offset clauses
///
/// This type is only relevant for implementing custom backends
#[derive(Debug, Clone, Copy, QueryId)]
#[cfg_attr(
    doc_cfg,
    doc(cfg(feature = "i-implement-a-third-party-backend-and-opt-into-breaking-changes"))
)]
pub struct LimitOffsetClause<Limit, Offset> {
    /// The limit clause
    pub limit_clause: Limit,
    /// The offset clause
    pub offset_clause: Offset,
}

/// A boxed variant of [`LimitOffsetClause`](crate::query_builder::LimitOffsetClause)
///
/// This type is only relevant for implementing custom backends
#[allow(missing_debug_implementations)]
#[cfg_attr(
    doc_cfg,
    doc(cfg(feature = "i-implement-a-third-party-backend-and-opt-into-breaking-changes"))
)]
pub struct BoxedLimitOffsetClause<'a, DB> {
    /// The limit clause
    pub limit: Option<Box<dyn QueryFragment<DB> + Send + 'a>>,
    /// The offset clause
    pub offset: Option<Box<dyn QueryFragment<DB> + Send + 'a>>,
}