helper_sql pylint fixes

v0.6
lakshyacis 3 years ago
parent ece3005f42
commit e47b573b3e
No known key found for this signature in database
GPG Key ID: D2C539C8EC63E9EB
  1. 6
      src/helper_sql.py

@ -2,9 +2,11 @@
SQL-related functions defined here are really pass the queries (or other SQL
commands) to :class:`.threads.sqlThread` through `sqlSubmitQueue` queue and check
or return the result got from `sqlReturnQueue`.
This is done that way because :mod:`sqlite3` is so thread-unsafe that they
won't even let you call it from different threads using your own locks.
SQLite objects can only be used from one thread.
.. note:: This actually only applies for certain deployments, and/or
really old version of sqlite. I haven't actually seen it anywhere.
Current versions do have support for threading and multiprocessing.
@ -92,13 +94,15 @@ def sqlExecute(sqlStatement, *args):
sqlLock.release()
return rowcount
def sqlStoredProcedure(procName):
"""Schedule procName to be run"""
sqlLock.acquire()
sqlSubmitQueue.put(procName)
sqlLock.release()
class SqlBulkExecute:
class SqlBulkExecute(object):
"""This is used when you have to execute the same statement in a cycle."""
def __enter__(self):

Loading…
Cancel
Save