-
-
Notifications
You must be signed in to change notification settings - Fork 678
Open
Description
Motivation
I frequently query one row of something using .one(db) method and return an error if its None.
It would be nice to have a distinction between fetching one row and fetching optional row since its quite common(like in sqlx).
Proposed Solutions
I propose to add another method to various query implementations, to query non-optional and return
Lines 51 to 53 in 4f89d1b
| /// The record was not found in the database | |
| #[error("RecordNotFound Error: {0}")] | |
| RecordNotFound(String), |
this error on None.
Additional Information
I think this feature would be relevant after error refactor proposed in one of the recent issues.
Naming this method seems a big problem as .one(db) is already taken for optional variant.
I can implement myself if needed.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels