drizzle-relations

Installation
SKILL.md

Drizzle Relations Skill

Drizzle's db.query.* API with with (eager loading) requires explicit relation definitions. Without them you get:

TypeError: Cannot read properties of undefined (reading 'referencedTable')

The two things required

  1. A *.relations.ts file for every table that has relations
  2. All schemas AND relations registered in db/drizzle.ts

Both are required. Missing either one causes the error.

Relation patterns

Many-to-one (foreign key side)

Installs
1
GitHub Stars
2
First Seen
Sep 28, 2026