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

Prefixed tables, linked tables(join), conditional queries(where), and field types cannot be automatically generated from the model. #4936

Open
conero opened this issue Dec 18, 2021 · 0 comments
Assignees
Labels
type:with reproduction steps with reproduction steps

Comments

@conero
Copy link

conero commented Dec 18, 2021

GORM Playground Link

go-gorm/playground#418

Description

  • Tables with prefixes cannot specify query fields, so additional methods must be written. Wish that automatically generate corresponding fields according to the model.
  • The association model specifies the association type, like Inner/right join, the example is automatically left join.
  • Field conditions(where) can be set for prefixed association models.

Model: User/Company

-- mysql
select  `_prefixed_user`.name username,  `_prefixed_company`.name  from `_prefixed_user` inner join `_prefixed_company` on `_prefixed_user`.company_id=`_prefixed_company`.id
    where `_prefixed_company`.name like '%JC.inc%';
@github-actions github-actions bot added the type:with reproduction steps with reproduction steps label Dec 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:with reproduction steps with reproduction steps
Projects
None yet
Development

No branches or pull requests

2 participants