summaryrefslogtreecommitdiff
path: root/client/src/leap/soledad/client/adbapi.py
diff options
context:
space:
mode:
authordrebs <drebs@leap.se>2015-05-04 13:04:56 -0300
committerdrebs <drebs@leap.se>2015-05-20 10:16:46 -0300
commit3a7ddacd06fd57afb10cc3d7083c2aa196c9328f (patch)
tree7c5dbb40a7f01e087101df08d7824afbd8abc27b /client/src/leap/soledad/client/adbapi.py
parentb75bedb065cfbbb2993659d867ef554ff70596ae (diff)
[feature] use async adbapi for async decryption
Since we started implementing twisted api in soledad, some pieces are missing. Accessing the sqlcipher database directly with the twisted adbapi facilities is one of them. The async encryption/decryption was touching the database directly, and this was causing some difficulties like having different threads accessing the same database. This commit implements the twisted adbapi stuff for the asynchronous encryption/decryption facilities. Next steps would be use async adbapi for async encryption and use async adbapi for all sqlcipher access.
Diffstat (limited to 'client/src/leap/soledad/client/adbapi.py')
-rw-r--r--client/src/leap/soledad/client/adbapi.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/client/src/leap/soledad/client/adbapi.py b/client/src/leap/soledad/client/adbapi.py
index 7ad10db5..5b882bbe 100644
--- a/client/src/leap/soledad/client/adbapi.py
+++ b/client/src/leap/soledad/client/adbapi.py
@@ -32,6 +32,7 @@ from zope.proxy import ProxyBase, setProxiedObject
from pysqlcipher.dbapi2 import OperationalError
from leap.soledad.client import sqlcipher as soledad_sqlcipher
+from leap.soledad.client.pragmas import set_init_pragmas
logger = logging.getLogger(name=__name__)
@@ -72,7 +73,7 @@ def getConnectionPool(opts, openfun=None, driver="pysqlcipher"):
:rtype: U1DBConnectionPool
"""
if openfun is None and driver == "pysqlcipher":
- openfun = partial(soledad_sqlcipher.set_init_pragmas, opts=opts)
+ openfun = partial(set_init_pragmas, opts=opts)
return U1DBConnectionPool(
"%s.dbapi2" % driver, database=opts.path,
check_same_thread=False, cp_openfun=openfun,