Error loading books: TypeError: Cannot read properties of undefined (reading 'referencedTable')
I searched and found a similar github issue that mentioned to fix this, I have to relations generated by drizzle, but I can't find any relations automatically being generated.

3 Replies
sample schema :
sample code :
do I need to define relations manually?
bump
Yes, you do.
https://orm.drizzle.team/docs/relations
Drizzle ORM - Relations
Drizzle ORM is a lightweight and performant TypeScript ORM with developer experience in mind.
You don't need to use the Relations API if you don't want to. Simply create proper FKs and structuring your schema properly is enough to use the SQL-like
select
API.
If you don't create the relations, you can't use the query
API.