It appears that in SQL null = null returns false. I can see this making sense in some circumstances where null means unknown/unspecified, but often null is used very intentionally to mean known and well defined absence, in those situations I would love for null = null to be true.
What is the proper way to deal with this when using sqlite3? As currently doing anything like:
c.execute('select * from foo where bar = ?', [bar])
will break if bar is None, whereas I very much want it to return every row where bar is null. This all works seamlessly in Haskell's persistent which is what I am using on the other end, (FooBar ==. Nothing), so I was hoping for something similarly clean on the Python end.