Search
Star
Feedback
Setup for Free
ยฉ 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
How to check if a row exists in Drizzle? - Drizzle Team
DT
Drizzle Team
โข
3y ago
โข
5 replies
Zamiel
How to check if a row exists in Drizzle?
According to this StackOverflow post
:
https://stackoverflow.com/questions/7471625/fastest-check-if-row-exists-in-postgresql
The most performant way to check if a row exists is as follows
:
SELECT
EXISTS
(
SELECT
1
FROM
foo
WHERE
id
=
123
)
SELECT
EXISTS
(
SELECT
1
FROM
foo
WHERE
id
=
123
)
How do you accomplish this in Drizzle
?
Drizzle Team
Join
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
11,879
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Similar Threads
Was this page helpful?
Yes
No
Similar Threads
How to get a plain row schema using drizzle-zod?
DT
Drizzle Team / help
11mo ago
how can i delete if row exists (where eq(xxx)), otherwise insert, in one query?
DT
Drizzle Team / help
3y ago
Insert row, on conflict do nothing, and "return the conflicted row if it exists" - in 1 query?
DT
Drizzle Team / help
15mo ago
Is it normal for drizzle to generate SQLs without "IF NOT EXISTS"?
DT
Drizzle Team / help
2y ago