Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE]: Many-to-many builder helper #704

Open
anthonyshew opened this issue Jun 3, 2023 · 0 comments
Open

[FEATURE]: Many-to-many builder helper #704

anthonyshew opened this issue Jun 3, 2023 · 0 comments
Labels
enhancement New feature or request priority Will be worked on next rqb relational queries

Comments

@anthonyshew
Copy link

anthonyshew commented Jun 3, 2023

Describe want to want

Piggybacking off of #703, it would be great if I there were a way to have a "many-to-many" builder so I don't have to write out as much code. Thinking of something like (pseudocode incoming):

// Using names from the Stackblitz in the linked issue...
const {   
  gamesToGenres,
  gameGenresRelation,
  genreGamesRelation,
  gamesToGenresRelations 
  } = manyToManyBuilder(games, gamesIdToLink, genres, genresIdToLink)

My motivation is to have a paved path instead of recreating the logic every time. It's enough code that it's easy to use the wrong id somewhere and create a problem for yourself. While I was trying to sort out of #703 was happening in my code or in Drizzle, I spent a pretty fair amount of time trying to make sure my tables were right.

I'd rather fall into the pit of success with a builder! 😄 The goal for the design of this feature is DX through simplicity. If someone wants to customize the relation variable names, junction table name, etc., they can write it them themselves.

@anthonyshew anthonyshew added the enhancement New feature or request label Jun 3, 2023
@L-Mario564 L-Mario564 added rqb relational queries priority Will be worked on next labels Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority Will be worked on next rqb relational queries
Projects
None yet
Development

No branches or pull requests

2 participants