Allow SQLResult to take in None or Statement values.
Review Request #11104 — Created July 30, 2020 and submitted
SQLResultnow gracefully handles adding a
Nonevalue, 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
It also now handles
Statementvalues, 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.
Statementhandling in some in-progress changes.