Allow SQLResult to take in None or Statement values.
Review Request #11104 — Created July 30, 2020 and submitted — Latest diff uploaded
SQLResult
now gracefully handles adding aNone
value, ignoring the
value instead of raising an exception. This helps avoid issues and
simplifies code that otherwise had to check values before adding to the
result.It also now handles
Statement
values, which are what most SQL
generation functions generate in Django 2.0 and higher. It will convert
them to SQL and ensure they have a trailing;
.Both of these will be more necessary with upcoming support for
constraints in Django 2.2+.
Unit tests pass on all versions of Django, for all databases.
Tested both
None
andStatement
handling in some in-progress changes.