Search
Star
Feedback
Setup for Free
© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Ways to check if a user liked - Drizzle Team
DT
Drizzle Team
•
2y ago
•
12 replies
B33fb0n3
Ways to check if a user liked
Imagine the following objects in your schema
:
Post, Likes, User
Post, Likes, User
.
Imagine also the following relations
:
User has many Likes
(own made Likes
)
Post has many Likes
Likes has one User
Likes has one Post
So
Likes
Likes
is the join table for the many
-to
-many connection between
"One Post has many likes
(from users
) and one User has many liked Posts
"
.
If I now want to load a feed
, how to effectively check
, if the user liked the post
, that the user see
's in his feed
?
By the way
: That is not the only part
, where this kind of solution append
. Imagine having a User
, that has many bought products
. And one Product has many users who bought that
. The join table is then something like
"purchase
"
, which contain a
one connection
one connection
to both
: Product and User
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
Recent Announcements
Similar Threads
Was this page helpful?
Yes
No
Similar Threads
How to check if a row exists in Drizzle?
DT
Drizzle Team / help
3y ago
How to check if is not null
DT
Drizzle Team / help
3y ago
How to check if an entry already exist?
DT
Drizzle Team / help
2y ago
How to check user input is a valid column before appending condition?
DT
Drizzle Team / help
2y ago