adrianbrowning / prisma-ts-select

A TypeSafe primsa extension allowing more fine grain control of selects
MIT License
2 stars 0 forks source link

Add Support for Many-To-Many Joins #19

Open adrianbrowning opened 4 months ago

adrianbrowning commented 4 months ago

Now that prisma generate is connected, we need to support many-to-many connections.

adrianbrowning commented 2 months ago

Instead of having to do:

prisma.$from("M2M_Post")
  .join("_M2M_CategoryToM2M_Post", "B", "M2M_Post.id")
  .join("M2M_Category", "id", "_M2M_CategoryToM2M_Post.A");

You can do, something like:

prisma.$from("M2M_Post")
  .manyToManyJoin("M2M_Category", "id", "M2M_Post.id" /*, optional ref name*/);