Skip to content

[Proposal]: Split exception for postgres fetch*() or allow returning null #2336

@stloyd

Description

@stloyd

Describe the Proposal

Right now, there is no easy way to make results nullable with PostgreSQL fetch*() methods. The problem is that the exception thrown when there are no results is also used when there is more than one result. But from a business perspective, those two things are completely different; while the first may be allowed in some cases, the second is most likely forbidden.

I would propose to:

  • either allow explicitly nullable methods as fetch*() ones (less convinced),
  • split exceptions for no result and more than one result (more convinced)

API Adjustments

No response

Are you intending to also work on proposed change?

Yes

Are you interested in sponsoring this change?

No

Integration & Dependencies

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions