Revision 140
Added by Aaron Marcuse-Kubitza almost 13 years ago
sql.py | ||
---|---|---|
52 | 52 |
|
53 | 53 |
def value(cur): return row(cur)[0] |
54 | 54 |
|
55 |
def value_or_none(cur): |
|
56 |
try: return value(cur) |
|
57 |
except StopIteration: return None |
|
58 |
|
|
55 | 59 |
def with_savepoint(db, func): |
56 | 60 |
savepoint = 'savepoint_'+str(random.randint(0, sys.maxint)) # must be unique |
57 | 61 |
run_query(db, 'SAVEPOINT '+savepoint) |
Also available in: Unified diff
Fixed DB input to ignore NULL values