@@ -45,7 +45,7 @@ pub fn derive(tokens: proc_macro::TokenStream) -> proc_macro::TokenStream {
let item_type = &field.1;
quote! {
- <#item_type as Default>::default().accept_item_visitor(v);
+ <#item_type as ::microrm::schema::DatabaseItem>::accept_item_visitor(&<#item_type as Default>::default(), v);
}
});
@@ -16,6 +16,7 @@ all-features = true
[features]
clap = ["dep:clap"]
bundled_sqlite = ["libsqlite3-sys/bundled"]
+unstable_migration = []
[dependencies]
libsqlite3-sys = "0.28"
@@ -28,6 +28,7 @@ pub mod relation;
/// Types related to indexes.
pub mod index;
+#[cfg(feature = "unstable_migration")]
pub mod migration;
mod build;
@@ -8,7 +8,7 @@ use std::collections::HashSet;
use crate::{
db::ConnectionLease,
query::Queryable,
- schema::{entity::EntityList, Schema},
+ schema::Schema,
DBResult,
};
@@ -126,20 +126,11 @@ struct SimpleDatabase {
impl Schema for SimpleDatabase {
- fn build() -> Self
+ fn accept_item_visitor(&self, visitor: &mut impl DatabaseItemVisitor)
where
Self: Sized,
{
- Self {
- strings: IDMap::build(),
- }
-
- fn accept_item_visitor(visitor: &mut impl DatabaseItemVisitor)
- where
- Self: Sized,
- {
- <IDMap<SimpleEntity> as DatabaseItem>::accept_item_visitor(visitor);
+ <IDMap<SimpleEntity> as DatabaseItem>::accept_item_visitor(&IDMap::default(), visitor);
@@ -1,3 +1,5 @@
+#![cfg(feature = "unstable_migration")]
+
use microrm::{
prelude::*,
schema::migration::{Migration, Migrator},