diff options
Diffstat (limited to 'doc')
-rw-r--r-- | doc/build/changelog/changelog_11.rst | 11 | ||||
-rw-r--r-- | doc/build/changelog/migration_11.rst | 24 |
2 files changed, 35 insertions, 0 deletions
diff --git a/doc/build/changelog/changelog_11.rst b/doc/build/changelog/changelog_11.rst index 709eaab5e..789a241d0 100644 --- a/doc/build/changelog/changelog_11.rst +++ b/doc/build/changelog/changelog_11.rst @@ -134,6 +134,17 @@ :ref:`change_3653` .. change:: + :tags: feature, sql + + New :meth:`.ColumnOperators.is_distinct_from` and + :meth:`.ColumnOperators.isnot_distinct_from` operators; pull request + courtesy Sebastian Bank. + + .. seealso:: + + :ref:`change_is_distinct_from` + + .. change:: :tags: bug, orm :tickets: 3488 diff --git a/doc/build/changelog/migration_11.rst b/doc/build/changelog/migration_11.rst index b217f0420..d9f48fcb1 100644 --- a/doc/build/changelog/migration_11.rst +++ b/doc/build/changelog/migration_11.rst @@ -1137,6 +1137,30 @@ will not have much impact on the behavior of the column during an INSERT. :ticket:`3216` +.. _change_is_distinct_from: + +Support for IS DISTINCT FROM and IS NOT DISTINCT FROM +------------------------------------------------------ + +New operators :meth:`.ColumnOperators.is_distinct_from` and +:meth:`.ColumnOperators.isnot_distinct_from` allow the IS DISTINCT +FROM and IS NOT DISTINCT FROM sql operation:: + + >>> print column('x').is_distinct_from(None) + x IS DISTINCT FROM NULL + +Handling is provided for NULL, True and False:: + + >>> print column('x').isnot_distinct_from(False) + x IS NOT DISTINCT FROM false + +For SQLite, which doesn't have this operator, "IS" / "IS NOT" is rendered, +which on SQLite works for NULL unlike other backends:: + + >>> from sqlalchemy.dialects import sqlite + >>> print column('x').is_distinct_from(None).compile(dialect=sqlite.dialect()) + x IS NOT NULL + .. _change_1957: Core and ORM support for FULL OUTER JOIN |