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

Allow model to have missing fields when .Column("*") is used #1025

Closed
acomanescu opened this issue Sep 25, 2024 · 2 comments
Closed

Allow model to have missing fields when .Column("*") is used #1025

acomanescu opened this issue Sep 25, 2024 · 2 comments
Labels

Comments

@acomanescu
Copy link

Is there any way to allow the model to have missing (undeclared) fields (columns) when .Column("*") is used?

Example:

db.NewSelect().Model(&user).Column("*")

This throws an error if the users table has a column that is not defined in the User model. I need a smaller model that does not include every column in the table.

I know that I can define each column I need in the .Column("col1", "col2") but I wish that I don't have to write the entire model manually.

@fsblemos
Copy link

fsblemos commented Oct 2, 2024

Copy link

This issue has been automatically marked as stale because it has not had activity in the last 30 days. If there is no update within the next 7 days, this issue will be closed.

@github-actions github-actions bot added the stale label Nov 19, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants