From 3351f5f93ca1968653becbed7f1ddef7afb96077 Mon Sep 17 00:00:00 2001 From: Sebastian Bank Date: Mon, 11 Apr 2016 23:16:32 -0400 Subject: Add IS (NOT) DISTINCT FROM operators None / True / False render as literals. For SQLite, "IS" is used as SQLite lacks "IS DISTINCT FROM" but its "IS" operator acts this way for NULL. Doctext-author: Mike Bayer Change-Id: I9227b81f7207b42627a0349d14d40b46aa756cce Pull-request: https://github.com/zzzeek/sqlalchemy/pull/248 --- lib/sqlalchemy/sql/compiler.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/sqlalchemy/sql/compiler.py') diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py index 3d2f02006..144f2aa47 100644 --- a/lib/sqlalchemy/sql/compiler.py +++ b/lib/sqlalchemy/sql/compiler.py @@ -81,6 +81,8 @@ OPERATORS = { operators.gt: ' > ', operators.ge: ' >= ', operators.eq: ' = ', + operators.is_distinct_from: ' IS DISTINCT FROM ', + operators.isnot_distinct_from: ' IS NOT DISTINCT FROM ', operators.concat_op: ' || ', operators.match_op: ' MATCH ', operators.notmatch_op: ' NOT MATCH ', -- cgit v1.2.1