Skip to content

Commit 0eb0d04

Browse files
committed
2 parents 9e17c5d + 755e814 commit 0eb0d04

2 files changed

Lines changed: 5 additions & 2 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: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import random
1919
import shutil
2020
from typing import Dict, Literal, Union
21+
from sqlcipher3 import dbapi2
2122

2223

2324
class insert:
@@ -80,7 +81,7 @@ def getPublicKeyFromEmail(self, email: str) -> Union[str, None]:
8081
def encriptarBD(self, DB_NAME: str) -> str:
8182
secPhase = 'BD en blanco solo con parámetros definidos por Enlaces-Mineduc'
8283
engine = create_engine(
83-
f"sqlite+pysqlcipher://:{secPhase}@/{DB_NAME}?cipher=aes-256-cfb&kdf_iter=64000")
84+
f"sqlite+pysqlcipher://:{secPhase}@/{DB_NAME}?cipher=aes-256-cfb&kdf_iter=64000",module=dbapi2)
8485
conn = engine.connect()
8586
conn.execute(f"PRAGMA key = '{secPhase}';")
8687
psw = ''.join(random.choice(string.ascii_uppercase +
@@ -158,7 +159,7 @@ 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",module=dbapi2)
162163
conn = engine.connect()
163164
for root, dirs, files in os.walk(path_to_dir_csv_file, topdown=False):
164165
for name in files:

0 commit comments

Comments
 (0)