最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

node.js - Drizzle with Postgress picks up only 1 relation - Stack Overflow

programmeradmin3浏览0评论

I have a problem with drizzle orm, when i use multiple relations() for easier use, intellisense and typesafety goes wrong.

My example is below.

I have following entities exported all in index.db.ts file.

Here is my definition for categories with relations.

Everything is fine and i see typesafety and intellisense.

However when i add second/different/another relation for different entity like this

I loose the typesafety and intellisense.

Does anybody have any idea why or encountered this case?

I have a problem with drizzle orm, when i use multiple relations() for easier use, intellisense and typesafety goes wrong.

My example is below.

I have following entities exported all in index.db.ts file.

Here is my definition for categories with relations.

Everything is fine and i see typesafety and intellisense.

However when i add second/different/another relation for different entity like this

I loose the typesafety and intellisense.

Does anybody have any idea why or encountered this case?

Share Improve this question asked Mar 31 at 13:22 StykPohlavssonStykPohlavsson 3047 silver badges15 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

I have found finally the answer. Its here in another post.

How to declare self-referencing foreign key with Drizzle ORM

I was self referencing categories table with parentCategoryId

发布评论

评论列表(0)

  1. 暂无评论