This pull request addresses the issue where the tables_involved property of the SQLQuery model fails to recognize tables involved in UPDATE operation. The current implementation only captures tables involved in SELECT and JOIN operations.
The updated implementation includes UPDATE operation to ensure comprehensive table identification. The modified code is as follows:
class SQLQuery(models.Model):
query = TextField()
...
@property
def tables_involved(self):
...
for idx, component in enumerate(components):
...
if (
component.lower() == "from"
or component.lower() == "join"
or component.lower() == "as"
or component.lower() == "update"
):
...
return tables
By including update statement, this change ensures that all relevant tables are captured for a more complete SQL query analysis. This update helps in better tracking and debugging of SQL queries within Django applications.
This pull request addresses the issue where the
tables_involved
property of the SQLQuery model fails to recognize tables involved in UPDATE operation. The current implementation only captures tables involved in SELECT and JOIN operations.The updated implementation includes UPDATE operation to ensure comprehensive table identification. The modified code is as follows:
By including update statement, this change ensures that all relevant tables are captured for a more complete SQL query analysis. This update helps in better tracking and debugging of SQL queries within Django applications.
Fixes #716