nongoose 0.1.0-beta.1

ODM for MongoDB based on Mongoose
Documentation
use crate::types::SchemaRelation;

#[derive(Clone, Debug, PartialEq)]
pub struct SchemaData {
  name: String,
  relations: Vec<SchemaRelation>,
}

impl SchemaData {
  pub(crate) fn new<T>() -> Self
  where
    T: super::Schema,
  {
    Self {
      name: T::__get_collection_name(),
      relations: T::__relations(),
    }
  }

  pub fn get_name(&self) -> String {
    self.name.clone()
  }

  pub fn get_relations(&self) -> Vec<SchemaRelation> {
    self.relations.clone()
  }
}