pub const MAX_QUERY_LIMIT: u32 = 1000;
pub const MAX_QUERY_OFFSET: u32 = 1_000_000;
mod predicates;
#[cfg(any(
feature = "compiler-sql",
feature = "compiler-mongodb",
feature = "compiler-redis",
feature = "compiler-indradb",
))]
mod sql_document;
mod sql_helpers;
mod sql_row_filter;
mod types;
#[cfg(all(test, feature = "compiler-surreal"))]
mod sql_emit_tests;
pub use predicates::{
DateTimePredicate, IdOnlyRecord, IntPredicate, NullPredicate, OrderBy, RecordPredicate,
SortDirection, StringPredicate,
};
pub use sql_row_filter::{apply_equality_where, apply_order_limit_offset};
pub use types::{HopSource, HopType, QueryCore, WhereClause};
#[cfg(test)]
mod clamp_tests {
use super::*;
#[test]
fn limit_and_offset_clamp_on_builder() {
let q = QueryCore::new("t".into()).limit(u32::MAX).offset(u32::MAX);
assert_eq!(q.limit, Some(MAX_QUERY_LIMIT));
assert_eq!(q.offset, Some(MAX_QUERY_OFFSET));
}
}