-
Notifications
You must be signed in to change notification settings - Fork 58
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
Linter should fail, or at least warn, when ran against an unsupported vendor #138
Comments
Hi @vanschelven On the general aspect of warning/failing when the migration linter is ran against an unsupported DB sounds like a good idea. In theory, the base analyser should be able to handle the basic cases, as long as the target DB uses standard SQL statements - but a warning is not a bad idea 👍 On the specific case that |
I have to admit that I already noticed that On second thought, however, I realise that there the mapping (development <=> sqlite) may often occur in practice but is by no means absolute. Given that there are still scenarios (such as mine) in which silent ignoring is in fact fine, so outright crashing is not desired, I will file an issue to raise a warning in that package also.
Yeah... sqlite is probably the outlier here with its full regeneration of tables for any change, so I'm tempted to go with warning too. |
When the linter is run against an unsupported database vendor, it will happily try to do its job using the generic
BaseAnalyser
Given the heavy use of analysis of SQL statements, this seems an overly optimistic approach, which will lead to hard to debug problems. Better to just fail outright and tell the user about the misconfiguration.
In particular, I ran into this when doing my analysis against sqlite3, and wondering why using an
AddDefaultValue
from thedjango-add-default-value
package doesn't do its magic (i.e. making the linter succeed).The answer is: because that package does nothing in the case of sqlite3 (which is probably what you want, so that you can use the code from that package in testing environments as well as production ones). Which means that the generated sql does not contain the strings that the present package searches for.
The text was updated successfully, but these errors were encountered: