use std::any::Any;
use vantage_core::Result;
use crate::any::AnyTable;
pub mod foreign;
pub mod many;
pub mod one;
pub use foreign::HasForeign;
pub use many::HasMany;
pub use one::HasOne;
pub trait Reference: Send + Sync {
fn columns(&self, source_id: &str, target_id: &str) -> (String, String);
fn build_target(&self, data_source: &dyn Any) -> Box<dyn Any>;
fn is_foreign(&self) -> bool {
false
}
fn resolve_as_any(&self, source_table: &dyn Any) -> Result<AnyTable>;
fn target_type_name(&self) -> &'static str;
}