drizzle-team / drizzle-team/drizzle-orm

[FEATURE]: Exists function when making queries

Open
#1,689 7 comments 67 reactions 0 assignees View on GitHub
enhancement qb/crud
Dominant language
TypeScript
Stars
35.8k
Forks
1.6k
Avg merge
2d 7h
Merged PRs (30d)
4

Description

### Describe what you want

It would be handy to be able to make a query like:
```ts
await db.query.users.exists({ where: whereCondition });
```
that returns a boolean value. Under the hood it would simply run:
```ts
return !!(await db.query.user.findFirst({ columns: {}, where: whereCondition }))
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.