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: add ModelTableExpr to TruncateTableQuery #969

Merged

Conversation

JunNishimura
Copy link
Contributor

@JunNishimura JunNishimura commented Apr 1, 2024

This PR fixes #960.

I implemented a ModelTableExpr method in TruncateTableQuery as well, referring to CreateTableQuery, etc.

The Document stated that ModelTableExpr can be used, but it is not implemented actually, so I made this modification.

I would appreciate it if you check it out!

_, err := m.db.NewTruncateTable().TableExpr(m.table).Exec(ctx)
_, err := m.db.NewTruncateTable().
ModelTableExpr(m.table).
Exec(ctx)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not look right, because there is no Model call. Could you revert it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vmihailenco
Thanks for the reply.

Referring to other implementations, I decided that it would be better to call a Model method than to revert.
I would appreciate it if you could check the following commit again. 27193c3

@JunNishimura JunNishimura changed the title add ModelTableExpr to TruncateTableQuery feat: add ModelTableExpr to TruncateTableQuery Apr 2, 2024
@vmihailenco vmihailenco merged commit 7bc330f into uptrace:master Apr 3, 2024
3 of 4 checks passed
@JunNishimura JunNishimura deleted the add_model_table_expr_to_truncate branch April 3, 2024 13:35
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

Successfully merging this pull request may close these issues.

TrunateTableQuery: missing ModelTableExpr() method
2 participants