diff --git a/cli/util.py b/cli/util.py index 81cd483..8705d36 100644 --- a/cli/util.py +++ b/cli/util.py @@ -1,6 +1,12 @@ import os import tempfile +def execute_query(cursor, query, bindings): + for (key, val) in bindings.items(): + if val == None: + query = query.replace('%(' + key + ')d', 'NULL') + cursor.execute(query, bindings) + def make_result_dict(cursor, row): d = {} for i in xrange(len(row)):