Skip to content

Commit 84da868

Browse files
committed
add module dbapi2
1 parent f6db00c commit 84da868

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

ede/ede/checkSQLiteEDE.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from sqlalchemy import event
1616
from sqlalchemy.engine import Engine
1717
from typing import Union
18+
from sqlcipher3 import dbapi2
1819

1920
from ede.ede.validation_functions.check_utils import validateJSON
2021

@@ -323,6 +324,7 @@ def execute(self):
323324
sec = self.args.secPhase
324325
path = self.args.path_to_DB_file
325326
engine = create_engine(f"sqlite+pysqlcipher://:{sec}@/{path}?cipher=aes-256-cfb&kdf_iter=64000"
327+
,module=dbapi2
326328
# ,connect_args={'timeout': 10000}
327329
)
328330
try:

ede/ede/insertCSVtoSQLite.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import random
1919
import shutil
2020
from typing import Dict, Literal, Union
21-
21+
from sqlcipher3 import dbapi2
2222

2323
class insert:
2424
def __init__(self, args):
@@ -80,7 +80,8 @@ def getPublicKeyFromEmail(self, email: str) -> Union[str, None]:
8080
def encriptarBD(self, DB_NAME: str) -> str:
8181
secPhase = 'BD en blanco solo con parámetros definidos por Enlaces-Mineduc'
8282
engine = create_engine(
83-
f"sqlite+pysqlcipher://:{secPhase}@/{DB_NAME}?cipher=aes-256-cfb&kdf_iter=64000")
83+
f"sqlite+pysqlcipher://:{secPhase}@/{DB_NAME}?cipher=aes-256-cfb&kdf_iter=64000"
84+
,module=dbapi2)
8485
conn = engine.connect()
8586
conn.execute(f"PRAGMA key = '{secPhase}';")
8687
psw = ''.join(random.choice(string.ascii_uppercase +
@@ -158,7 +159,8 @@ def dict_factory(self, rows, tbl) -> Dict:
158159
def transferCSVToSQL_withPandas(self, path_to_dir_csv_file, DB_NAME: str, secPhase: str) -> bool:
159160
_r = True
160161
engine = create_engine(
161-
f"sqlite+pysqlcipher://:{secPhase}@/{DB_NAME}?cipher=aes-256-cfb&kdf_iter=64000")
162+
f"sqlite+pysqlcipher://:{secPhase}@/{DB_NAME}?cipher=aes-256-cfb&kdf_iter=64000"
163+
,module=dbapi2)
162164
conn = engine.connect()
163165
for root, dirs, files in os.walk(path_to_dir_csv_file, topdown=False):
164166
for name in files:

0 commit comments

Comments
 (0)