diff --git a/macro/src/codegen/insert_model.rs b/macro/src/codegen/insert_model.rs index 1acafdf..c358d5c 100644 --- a/macro/src/codegen/insert_model.rs +++ b/macro/src/codegen/insert_model.rs @@ -23,7 +23,7 @@ pub fn struct_InsertModel(ast: &DeriveInput, attr: &ModelMeta) -> TokenStream { #vis struct #insert_model { #(#struct_fields,)* } - } + } } else { quote! { #[derive(Debug)] diff --git a/macro/src/lib.rs b/macro/src/lib.rs index 06b6f09..46ede0b 100644 --- a/macro/src/lib.rs +++ b/macro/src/lib.rs @@ -320,7 +320,11 @@ pub fn derive_ormlite_enum(input: TokenStream) -> TokenStream { impl sqlx::Type for #enum_name { fn type_info() -> ::TypeInfo { - >::type_info() + sqlx::postgres::PgTypeInfo::with_name("TEXT") + } + + fn compatible(ty: &::TypeInfo) -> bool { + ty.to_string() == "TEXT" } } };