drizzle-team / drizzle-team/drizzle-orm
[FEATURE]: method `.single()` for select query
- Dominant language
- TypeScript
- Stars
- 35.8k
- Forks
- 1.6k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 4
Description
### Feature hasn't been suggested before.
- [x] I have verified this feature I'm about to request hasn't been suggested before.
### Describe the enhancement you want to request
Hello Drizzle Team,
I suggest method `.single()`
A method that returns a single row is very useful. as you can see in the image I only want to get a single row from the table. with `.limit(1)` I know for sure that the output has `<= 1` items. but when I access it I have to keep using `results[0]` or shorthand it `const [result] = await db...` however it loses the type feature of typescript because `results[0]` (`result`) is recognized by typescript as `Row` while it can be `undefined`

Contributor guide
Assessment
This issue has not been assessed yet.