use std::collections::HashMap;
use crate::{Expr, OrderBy, Value};
#[derive(Debug, Default, Clone)]
pub struct IncludeRelation {
pub where_: Option<Expr>,
}
impl IncludeRelation {
pub fn plain() -> Self {
IncludeRelation { where_: None }
}
pub fn with_filter(filter: Expr) -> Self {
IncludeRelation {
where_: Some(filter),
}
}
}
#[derive(Debug, Clone)]
pub struct FindUniqueArgs {
pub where_: Expr,
pub select: HashMap<String, bool>,
}
impl FindUniqueArgs {
pub fn new(filter: Expr) -> Self {
FindUniqueArgs {
where_: filter,
select: HashMap::new(),
}
}
}
#[derive(Debug, Default, Clone)]
pub struct FindManyArgs {
pub where_: Option<Expr>,
pub order_by: Vec<OrderBy>,
pub take: Option<i32>,
pub skip: Option<u32>,
pub include: HashMap<String, IncludeRelation>,
pub select: HashMap<String, bool>,
pub cursor: Option<HashMap<String, Value>>,
pub distinct: Vec<String>,
}