tags:

views:

35

answers:

1

Currently, Python is storing the string "None" for nulls returned by sqlite3. I read that you can change the default value for nulls in sqlite3 at the command line, but can you set this within the Python code?

I'd like all of my blank results to look the same without having to loop through and check each value. So I want any nulls returned from sqlite3 to be an empty string ("") instead of "None".

A: 

In docs there is an explanation with examples of how to make use of converters and adapters.

SilentGhost
Yes, I read that section, but unless I'm missing something, it does not help in this situation. I don't have one specific column that I'm selecting that has nulls, nor a specific data type that is coming back null, almost any column can come back with nulls using a left join.
javovo