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

[Feat] Can the JoinModel method be supported? #940

Open
ilxqx opened this issue Dec 11, 2023 · 0 comments
Open

[Feat] Can the JoinModel method be supported? #940

ilxqx opened this issue Dec 11, 2023 · 0 comments

Comments

@ilxqx
Copy link

ilxqx commented Dec 11, 2023

Just like db.NewSelect().Model(entity), after specifying the Model, you can read the table name and alias information automatically. However, it is a bit difficult for Join because we need to hardcode the table name and alias ourselves. This work is obviously redundant and unnecessary. I think we can completely solve this problem by using the concept of JoinModel (similar to Model), which can improve efficiency and reduce code duplication.

At the same time, for Join, although we need to write INNER JOIN or LEFT/RIGHT JOIN ourselves, I also think this can be solved by adding a few methods:

  • LeftJoin()
  • RightJoin()

I have an idea to submit a Pull Request, but before that, I would like to discuss their feasibility first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant