[DB-SIG] DB API 2.0... what about NULLs ?

M.-A. Lemburg mal@lemburg.com
Wed, 14 Apr 1999 15:48:49 +0200


M.-A. Lemburg wrote:
> 
> I just realized that there is no mention of what to do about
> SQL NULL values on the Python side of things.
> 
> Maybe we can sneak that definition into 2.0 before Andrew updates
> the SIGs web-page...
> 
> Most interface modules already do the "right thing" w/r to NULL:
> they simply use None as Python equivalent. This means we could add
> a sentence:
> 
>           SQL NULL values are represented by the Python
>           None singleton on input and output.
> 
> and/or add an aliase NULL for None that the module has to define.
> 

Here is the text I'd like to add to the Type Objects section:

"""
NULL 
     SQL NULL values are represented by the Python None singleton
     on input and output. NULL is an alias for None that the module must
     define if the database supports NULL values. 
"""

This has the added advantage of being able to check for NULL
support via hasattr(), e.g. Gadfly should not define it.

If nobody objects, I'll update the spec on starship later today.

-- 
Marc-Andre Lemburg                               Y2000: 261 days left
---------------------------------------------------------------------
          : Python Pages >>> http://starship.skyport.net/~lemburg/  :
           ---------------------------------------------------------