Skip to content

docs: native enum rs_type = "Enum" breaking change in 2.0 - #180

Open
lethib wants to merge 2 commits into
SeaQL:masterfrom
lethib:docs/native-enum-rs-type-v2
Open

lethib wants to merge 2 commits into
SeaQL:masterfrom
lethib:docs/native-enum-rs-type-v2

Conversation

@lethib

@lethib lethib commented Jul 2, 2026

Copy link
Copy Markdown

PR Info

New Features

  • N/A

Bug Fixes

  • N/A

Breaking Changes

  • Documents a breaking change introduced in SeaORM 2.0: native database enums now use rs_type = "Enum" instead of rs_type = "String". The ActiveEnum::Value associated type is now sea_query::Enum (carrying the enum type name as metadata) rather than String, which changes the signatures of to_value (now returns sea_query::Enum) and try_from_value (now expects &sea_query::Enum). String-backed (rs_type = "String") and integer-backed (rs_type = "i32") enums are unaffected. This is a docs-only PR describing that change.

Changes

  • 04-generate-entity/04-enumeration.md (the ActiveEnum page): update the Native Database Enum examples to rs_type = "Enum", and add a Since 2.0.0 note explaining the new sea_query::Enum value type, its struct shape, and how to convert to/from String.
  • 09-schema-statement/02-create-enum.md: update the Native Database Enum example to rs_type = "Enum" and cross-link to the ActiveEnum page.

@lethib lethib changed the title docs: native enum rs_type = "Enum" breaking change in 2.0 docs: native enum rs_type = "Enum" breaking change in 2.0 Jul 2, 2026
@lethib

lethib commented Oct 17, 2026

Copy link
Copy Markdown
Author

@tyt2y3 is that possible to have a review on that ?

let s: String = tea.to_value().value.into();
```

To convert a `String` **into** a native enum variant, construct a `sea_query::Enum` first:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have TryFrom<&str> implementation for it.

@Huliiiiii

Copy link
Copy Markdown
Member

I think this section reads more like a changelog or migration guide than feature documentation.

The historical behavior, breaking changes, and internal structure of sea_query::Enum don't seem necessary here. I'd prefer to keep this page focused on the current API and its recommended usage, with migration details documented separately.

The additional version note in the create enum page seems redundant as well.

@lethib
lethib requested a review from Huliiiiii October 19, 2026 10:26

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sea-orm-cli generate entity emits rs_type = "Enum" instead of rs_type = "String" for PostgreSQL native enums

2 participants