use toasty_core::{
driver::Capability,
schema::{
Builder,
app::{self, Model},
},
};
pub fn test_schema() -> toasty_core::Schema {
Builder::new()
.build(app::Schema::default(), &Capability::SQLITE)
.expect("empty schema should build")
}
pub fn test_schema_with(models: &[Model]) -> toasty_core::Schema {
let app_schema =
app::Schema::from_macro(models.iter().cloned()).expect("schema should build from macro");
Builder::new()
.build(app_schema, &Capability::SQLITE)
.expect("schema should build")
}
pub fn test_schema_postgresql(models: &[Model]) -> toasty_core::Schema {
let app_schema =
app::Schema::from_macro(models.iter().cloned()).expect("schema should build from macro");
Builder::new()
.build(app_schema, &Capability::POSTGRESQL)
.expect("schema should build")
}