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
Added test coverage for DatabaseOperations.sql_flush(). #12729
Conversation
I wonder if it would be better to write a backend agnostic test that executes the provided SQL and ensures tables are flushed and sequences are reset. I'm not sure there's a lot of values in asserting against the exact SQL generated since we offer no stability guarantees in this regard. |
I can work towards that.
I think it provides value. It shows exactly (modulo some ordering) the output of the function. We can inspect this output directly to ensure the commands that we expect to render, are returned. A change that unexpectedly changes these statements -- perhaps causing a regression -- will be noticed. One of the motivations of this PR is that I would like to change PostgreSQL I do agree there is additional value in executing the SQL as well. I think they would complement one another. |
Oh I looked at it as well while helping with the MySQL adjustments that took place in this area but I assumed it was only working with identity columns and thus was blocked by #30511. I must have misread the PostgreSQL documentation since it clearly state it will reset sequences as well. I don't see much harm in testing the exact SQL as well in this case. |
👍 I added |
No description provided.