Left / Right / Full Join in Drizzle ORM
From the Drizzle ORM cheat sheet ยท Joins ยท verified Jul 2026
Left / Right / Full Join
Return all rows from one or both tables, even without matches.
typescript
import { eq } from 'drizzle-orm';
// Left join โ all users, even without posts
const result = await db.select({
userName: users.name,
postTitle: posts.title, // nullable!
}).from(users)
.leftJoin(posts, eq(users.id, posts.authorId));๐ก Left join makes right-side columns nullable
โก Chain multiple joins for complex queries
๐ Full join makes both sides nullable
๐ข Drizzle adjusts TS types per join type
joinleft-joinright-joinfull-join