diff --git a/pgrx-sql-entity-graph/src/postgres_enum/mod.rs b/pgrx-sql-entity-graph/src/postgres_enum/mod.rs index af121374a..9323fef07 100644 --- a/pgrx-sql-entity-graph/src/postgres_enum/mod.rs +++ b/pgrx-sql-entity-graph/src/postgres_enum/mod.rs @@ -121,7 +121,7 @@ impl ToEntityGraphTokens for PostgresEnum { let (_static_impl_generics, static_ty_generics, static_where_clauses) = static_generics.split_for_impl(); - let variants = self.variants.iter(); + let variants = self.variants.iter().map(|variant| variant.ident.clone()); let sql_graph_entity_fn_name = syn::Ident::new(&format!("__pgrx_internals_enum_{}", name), Span::call_site()); diff --git a/pgrx-tests/src/tests/enum_type_tests.rs b/pgrx-tests/src/tests/enum_type_tests.rs index 87e1577f6..143797527 100644 --- a/pgrx-tests/src/tests/enum_type_tests.rs +++ b/pgrx-tests/src/tests/enum_type_tests.rs @@ -9,8 +9,9 @@ //LICENSE Use of this source code is governed by the MIT license that can be found in the LICENSE file. use pgrx::prelude::*; -#[derive(PostgresEnum, PartialEq, Debug)] +#[derive(PostgresEnum, PartialEq, Debug, Default)] pub enum Foo { + #[default] One, Two, Three,