Skip to content

Add select_except#3123

Open
WookiesRpeople2 wants to merge 2 commits into
SeaQL:masterfrom
WookiesRpeople2:feat/select_except
Open

Add select_except#3123
WookiesRpeople2 wants to merge 2 commits into
SeaQL:masterfrom
WookiesRpeople2:feat/select_except

Conversation

@WookiesRpeople2

Copy link
Copy Markdown

PR Info

Features

  • add select except, this will return all fields except the one that is passed as an argument, for example:
let bakers = Baker::find()
        .select_except([baker::Column::BakeryId])
        .all(&ctx.db)
        .await
        .unwrap()

The generated sql here will be

SELECT "baker"."id", "baker"."contact_details", "baker"."bakery_id" FROM "baker"

something that is worth noting is that select_exclude will only work on optional value's as the unwrap expects there to be a value present

`Result::unwrap()` on an `Err` value: Type("Missing value for column 'name'")

Breaking Changes

  • no breaking changes this is purely additions

Changes

  • added select_except function
  • ran make-sync.sh
  • added an integration test case

@WookiesRpeople2 WookiesRpeople2 changed the title feat: add select_except on select impl Add select_except Jul 8, 2026
Comment thread sea-orm-sync/src/query/select.rs Outdated
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 select_except

2 participants