This repository has been archived on 2024-11-30. You can view files and clone it, but cannot push or open issues or pull requests.
PyBitmessage-2024-11-30/src/helper_sql.py

34 lines
793 B
Python
Raw Normal View History

2013-08-27 02:00:30 +02:00
import shared
def sqlQuery(sqlStatement, *args):
shared.sqlLock.acquire()
shared.sqlSubmitQueue.put(sqlStatement)
if args == ():
shared.sqlSubmitQueue.put('')
else:
shared.sqlSubmitQueue.put(args)
queryreturn = shared.sqlReturnQueue.get()
shared.sqlLock.release()
return queryreturn
def sqlExecute(sqlStatement, *args):
shared.sqlLock.acquire()
shared.sqlSubmitQueue.put(sqlStatement)
if args == ():
shared.sqlSubmitQueue.put('')
else:
shared.sqlSubmitQueue.put(args)
shared.sqlReturnQueue.get()
shared.sqlSubmitQueue.put('commit')
shared.sqlLock.release()
def sqlStoredProcedure(procName):
shared.sqlLock.acquire()
shared.sqlSubmitQueue.put(procName)
shared.sqlLock.release()