use super::{Load, Model};
use crate::stmt::{IntoExpr, IntoInsert, List, Path};
use toasty_core::schema::app::FieldId;
pub trait Relation: Load<Output = Self> {
type Model: Model;
type Expr;
type Query;
type Create: Default + IntoInsert<Model = Self::Model> + IntoExpr<Self::Model>;
type Many;
type ManyField<Origin>;
type One;
type OneField<Origin>;
type OptionOne;
fn new_create() -> Self::Create {
Self::Create::default()
}
fn new_many_field<Origin>(path: Path<Origin, List<Self::Model>>) -> Self::ManyField<Origin>;
fn field_name_to_id(name: &str) -> FieldId;
fn nullable() -> bool {
false
}
}