|
@@ -67,7 +67,7 @@ pub fn derive(tokens: proc_macro::TokenStream) -> proc_macro::TokenStream {
|
|
|
|
|
|
quote! {
|
|
quote! {
|
|
#vis struct #part_combined_name;
|
|
#vis struct #part_combined_name;
|
|
- impl ::microrm::entity::EntityPart for #part_combined_name {
|
|
|
|
|
|
+ impl ::microrm::schema::entity::EntityPart for #part_combined_name {
|
|
type Datum = #part_type;
|
|
type Datum = #part_type;
|
|
type Entity = #entity_ident;
|
|
type Entity = #entity_ident;
|
|
fn part_name() -> &'static str {
|
|
fn part_name() -> &'static str {
|
|
@@ -142,20 +142,20 @@ pub fn derive(tokens: proc_macro::TokenStream) -> proc_macro::TokenStream {
|
|
#[derive(Clone, Copy, PartialEq, PartialOrd, Debug, Hash)]
|
|
#[derive(Clone, Copy, PartialEq, PartialOrd, Debug, Hash)]
|
|
#vis struct #id_ident (i64);
|
|
#vis struct #id_ident (i64);
|
|
|
|
|
|
- impl ::microrm::entity::EntityID for #id_ident {
|
|
|
|
|
|
+ impl ::microrm::schema::entity::EntityID for #id_ident {
|
|
type Entity = #entity_ident;
|
|
type Entity = #entity_ident;
|
|
|
|
|
|
fn from_raw(raw: i64) -> Self { Self(raw) }
|
|
fn from_raw(raw: i64) -> Self { Self(raw) }
|
|
fn into_raw(self) -> i64 { self.0 }
|
|
fn into_raw(self) -> i64 { self.0 }
|
|
}
|
|
}
|
|
|
|
|
|
- impl ::microrm::datum::Datum for #id_ident {
|
|
|
|
|
|
+ impl ::microrm::schema::datum::Datum for #id_ident {
|
|
fn sql_type() -> &'static str {
|
|
fn sql_type() -> &'static str {
|
|
- <i64 as ::microrm::datum::Datum>::sql_type()
|
|
|
|
|
|
+ <i64 as ::microrm::schema::datum::Datum>::sql_type()
|
|
}
|
|
}
|
|
|
|
|
|
fn bind_to<'a>(&self, stmt: &mut ::microrm::sqlite::Statement<'a>, index: usize) {
|
|
fn bind_to<'a>(&self, stmt: &mut ::microrm::sqlite::Statement<'a>, index: usize) {
|
|
- <i64 as ::microrm::datum::Datum>::bind_to(&self.0, stmt, index)
|
|
|
|
|
|
+ <i64 as ::microrm::schema::datum::Datum>::bind_to(&self.0, stmt, index)
|
|
}
|
|
}
|
|
|
|
|
|
fn build_from<'a>(
|
|
fn build_from<'a>(
|
|
@@ -166,7 +166,7 @@ pub fn derive(tokens: proc_macro::TokenStream) -> proc_macro::TokenStream {
|
|
where
|
|
where
|
|
Self: Sized,
|
|
Self: Sized,
|
|
{
|
|
{
|
|
- let raw = <i64 as ::microrm::datum::Datum>::build_from(adata, stmt, index)?;
|
|
|
|
|
|
+ let raw = <i64 as ::microrm::schema::datum::Datum>::build_from(adata, stmt, index)?;
|
|
Ok((Self(raw.0), raw.1))
|
|
Ok((Self(raw.0), raw.1))
|
|
}
|
|
}
|
|
|
|
|
|
@@ -175,25 +175,25 @@ pub fn derive(tokens: proc_macro::TokenStream) -> proc_macro::TokenStream {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- impl ::microrm::entity::Entity for #entity_ident {
|
|
|
|
|
|
+ impl ::microrm::schema::entity::Entity for #entity_ident {
|
|
type Parts = #parts_list;
|
|
type Parts = #parts_list;
|
|
type Uniques = #uniques_list;
|
|
type Uniques = #uniques_list;
|
|
type ID = #id_ident;
|
|
type ID = #id_ident;
|
|
|
|
|
|
- fn build(values: <Self::Parts as ::microrm::entity::EntityPartList>::DatumList) -> Self {
|
|
|
|
|
|
+ fn build(values: <Self::Parts as ::microrm::schema::entity::EntityPartList>::DatumList) -> Self {
|
|
Self {
|
|
Self {
|
|
#(#build_struct),*
|
|
#(#build_struct),*
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
fn entity_name() -> &'static str { #entity_name }
|
|
fn entity_name() -> &'static str { #entity_name }
|
|
- fn accept_part_visitor(v: &mut impl ::microrm::entity::EntityPartVisitor) {
|
|
|
|
|
|
+ fn accept_part_visitor(v: &mut impl ::microrm::schema::entity::EntityPartVisitor) {
|
|
#(
|
|
#(
|
|
#part_visit
|
|
#part_visit
|
|
);*
|
|
);*
|
|
}
|
|
}
|
|
|
|
|
|
- fn accept_part_visitor_ref(&self, v: &mut impl ::microrm::entity::EntityPartVisitor) {
|
|
|
|
|
|
+ fn accept_part_visitor_ref(&self, v: &mut impl ::microrm::schema::entity::EntityPartVisitor) {
|
|
#(
|
|
#(
|
|
#part_ref_visit
|
|
#part_ref_visit
|
|
);*
|
|
);*
|