Skip to content

Add prefix option to nested attribute in FromQueryResult and PartialModel#2989

Open
YouKnow-sys wants to merge 3 commits intoSeaQL:masterfrom
YouKnow-sys:nested-prefix-attribute
Open

Add prefix option to nested attribute in FromQueryResult and PartialModel#2989
YouKnow-sys wants to merge 3 commits intoSeaQL:masterfrom
YouKnow-sys:nested-prefix-attribute

Conversation

@YouKnow-sys
Copy link

@YouKnow-sys YouKnow-sys commented Mar 6, 2026

PR Info

New Features

  • add prefix option to nested attribute: #[sea_orm(nested(prefix = "..."))] for FromQueryResult and PartialModel derives.
  • compile-time error when multiple nested fields share the same type without distinct prefixes.

Bug Fixes

before this change having two nested model with same type will silently have unexpected behavior.

Breaking Changes

nothing, unless user depends on two field of same nested model have exactly same value... which is wrong behavior to begin with.

Changes

  • add get_list_args helper to GetMeta trait for parsing list-style attributes.
  • use syn::Error instead of custom Error enum in FromQueryResult derive for better error spans. (tbh we should do this for all other derive macros, but that's for another PR)

@YouKnow-sys YouKnow-sys force-pushed the nested-prefix-attribute branch from e2a85e4 to 8a7c868 Compare March 6, 2026 01:23
@YouKnow-sys YouKnow-sys force-pushed the nested-prefix-attribute branch from 8a7c868 to 0b67194 Compare March 6, 2026 01:40
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.

add prefix support to FromQueryResult nested attribute

1 participant