-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[FEATURE]: Support Polymorphic Association #1051
Copy link
Copy link
Closed
Labels
enhancementNew feature or requestNew feature or requestimplemented-in-betaFeatures and improvements that are implemented in the beta branch (or will be soon)Features and improvements that are implemented in the beta branch (or will be soon)rqbrelational queriesrelational queries
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestimplemented-in-betaFeatures and improvements that are implemented in the beta branch (or will be soon)Features and improvements that are implemented in the beta branch (or will be soon)rqbrelational queriesrelational queries
Type
Fields
Give feedbackNo fields configured for issues without a type.
Describe what you want
I'm looking for a Typesafe ORM that support for polymorphic associations.
To give a concrete example:
I have a
Commentmodel. I need this model to be associated with bothArticleandPhotomodels.Instead of creating separate tables or associations for comments on articles and comments on photos, I would prefer a unified approach where a single
Commentcan belong to either anArticleor aPhoto.Most ORMs (and query builders) except Prisma support polymorphic association.
Prisma is not taking interest in solving this issue: prisma/prisma#1644.
If you plan on implementing Prisma, that would be a killer feature that would be a reason in itself to use Drizzle.
A few teams have mentioned it explicitly in that issue.
Do you plan to support and document this feature in the near future ?