dbhydra 2.2.13__py3-none-any.whl → 2.2.14__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- dbhydra/src/abstract_db.py +5 -4
- dbhydra/src/mysql_db.py +1 -1
- {dbhydra-2.2.13.dist-info → dbhydra-2.2.14.dist-info}/METADATA +1 -1
- {dbhydra-2.2.13.dist-info → dbhydra-2.2.14.dist-info}/RECORD +7 -7
- {dbhydra-2.2.13.dist-info → dbhydra-2.2.14.dist-info}/LICENSE +0 -0
- {dbhydra-2.2.13.dist-info → dbhydra-2.2.14.dist-info}/WHEEL +0 -0
- {dbhydra-2.2.13.dist-info → dbhydra-2.2.14.dist-info}/top_level.txt +0 -0
dbhydra/src/abstract_db.py
CHANGED
|
@@ -73,7 +73,7 @@ class AbstractDb(abc.ABC):
|
|
|
73
73
|
# 'AbstractSet': set,
|
|
74
74
|
}
|
|
75
75
|
python_database_type_mapping = {}
|
|
76
|
-
def __init__(self, config_file="config.ini", db_details=None, debug_mode=False):
|
|
76
|
+
def __init__(self, config_file="config.ini", db_details=None, debug_mode=False, debug_message=""):
|
|
77
77
|
if db_details is None:
|
|
78
78
|
db_details = read_connection_details(config_file)
|
|
79
79
|
|
|
@@ -88,6 +88,7 @@ class AbstractDb(abc.ABC):
|
|
|
88
88
|
|
|
89
89
|
self.is_autocommiting=True
|
|
90
90
|
self.debug_mode = debug_mode
|
|
91
|
+
self.debug_message = debug_message
|
|
91
92
|
|
|
92
93
|
if "DB_PORT" in db_details.keys():
|
|
93
94
|
self.DB_PORT = int(db_details["DB_PORT"])
|
|
@@ -156,13 +157,13 @@ class AbstractDb(abc.ABC):
|
|
|
156
157
|
try:
|
|
157
158
|
if self.debug_mode:
|
|
158
159
|
with open("dbhydra_logs.txt","a+") as file:
|
|
159
|
-
file.write(str(datetime.datetime.now())+": DB "+str(self)+": _connect() called\n")
|
|
160
|
+
file.write(str(datetime.datetime.now())+": DB "+str(self)+": _connect() called, debug msg:"+str(self.debug_message)+"\n")
|
|
160
161
|
self._connect()
|
|
161
162
|
yield None
|
|
162
163
|
finally:
|
|
163
164
|
if self.debug_mode:
|
|
164
165
|
with open("dbhydra_logs.txt","a+") as file:
|
|
165
|
-
file.write(str(datetime.datetime.now())+": DB "+str(self)+": close_connection() called\n")
|
|
166
|
+
file.write(str(datetime.datetime.now())+": DB "+str(self)+": close_connection() called, debug msg:"+str(self.debug_message)+"\n")
|
|
166
167
|
self.close_connection()
|
|
167
168
|
|
|
168
169
|
@contextmanager
|
|
@@ -197,7 +198,7 @@ class AbstractDb(abc.ABC):
|
|
|
197
198
|
self.cursor.commit()
|
|
198
199
|
if self.debug_mode:
|
|
199
200
|
with open("dbhydra_logs.txt","a+") as file:
|
|
200
|
-
file.write(str(datetime.datetime.now())+": DB "+str(self)+": execute() called\n")
|
|
201
|
+
file.write(str(datetime.datetime.now())+": DB "+str(self)+": execute() called, debug msg:"+str(self.debug_message)+"\n")
|
|
201
202
|
with open("dbhydra_queries_logs.txt","a+") as file:
|
|
202
203
|
file.write(str(datetime.datetime.now())+": "+str(query)+"\n")
|
|
203
204
|
return(result)
|
dbhydra/src/mysql_db.py
CHANGED
|
@@ -57,7 +57,7 @@ class MysqlDb(AbstractDb):
|
|
|
57
57
|
self.connection.commit()
|
|
58
58
|
if self.debug_mode:
|
|
59
59
|
with open("dbhydra_logs.txt","a+") as file:
|
|
60
|
-
file.write(str(datetime.datetime.now())+": DB "+str(self)+": execute() called\n")
|
|
60
|
+
file.write(str(datetime.datetime.now())+": DB "+str(self)+": execute() called, debug msg:"+str(self.debug_message)+"\n")
|
|
61
61
|
with open("dbhydra_queries_logs.txt","a+") as file:
|
|
62
62
|
file.write(str(datetime.datetime.now())+": "+str(query)+"\n")
|
|
63
63
|
return result
|
|
@@ -2,12 +2,12 @@ dbhydra/__init__.py,sha256=DCocEeXf4QxdVlBRlNiFvuP5IZJ5aa77_DbUR-_4C14,65
|
|
|
2
2
|
dbhydra/dbhydra_core.py,sha256=jn0VC3LkawR2P0Yd_oZNEXqP9o2BPEtOBWGzgFwfJyA,2537
|
|
3
3
|
dbhydra/test_migrator.py,sha256=e3Nnb2mCd3CfjhjSexNg1tXVJMjkl5cCoYcuhbfZ4pM,803
|
|
4
4
|
dbhydra/src/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
|
-
dbhydra/src/abstract_db.py,sha256=
|
|
5
|
+
dbhydra/src/abstract_db.py,sha256=7Rv2XgdaKiQ5yBnU0EDh5uT8XbB3JI5Pis_in6iHn2c,7172
|
|
6
6
|
dbhydra/src/abstract_table.py,sha256=VBzK_xMmCdU2QN0jAeQYoXx9vsl73Y7ZZU2YjVuKEN4,18049
|
|
7
7
|
dbhydra/src/bigquery_db.py,sha256=77XsgvYbANlvYaJnuVve-kz-PNBx_CHoYCL-eYnA8e4,1834
|
|
8
8
|
dbhydra/src/migrator.py,sha256=QzaODEFfraD9_6HN_Osaidaj-nLYQryCYYWwJtUu3n8,18931
|
|
9
9
|
dbhydra/src/mongo_db.py,sha256=mP48zRjI7mXKpm45R8prroZI-Eo7JKf0KJqGX-oTy3w,1922
|
|
10
|
-
dbhydra/src/mysql_db.py,sha256=
|
|
10
|
+
dbhydra/src/mysql_db.py,sha256=lNWaS3YHtQE1Xii-ErWUDhxeo3b6HWgXxQAMJfgiGEE,3583
|
|
11
11
|
dbhydra/src/postgres_db.py,sha256=L7MaBq_6ArwDSP_5LaEqK58oLxZ1X7FgIokcDOSB7wk,1805
|
|
12
12
|
dbhydra/src/sqlserver_db.py,sha256=9Xi3NAliqM79MTV8fpNQb0nWMH8Bqjl1leJSEqgyT94,3611
|
|
13
13
|
dbhydra/src/tables.py,sha256=v2VxgjKiNQyCdQCuovhpeDklPaqOcPRssTAP0mF2jTw,47613
|
|
@@ -18,8 +18,8 @@ dbhydra/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
18
18
|
dbhydra/tests/test_cases.py,sha256=eAFGaHaIaab3md3HHm2_ryb_HHfObtcXDAEzLh4qWx8,508
|
|
19
19
|
dbhydra/tests/test_mongo.py,sha256=M8TD72M0iQAk7ZcLTWwLmcmmF_zwALnYEGTWjhQlq0s,1979
|
|
20
20
|
dbhydra/tests/test_sql.py,sha256=aPFXyA0jh8o9VG3B5f9fNz7qDbuVPZ9TcE2twn5dAeQ,3126
|
|
21
|
-
dbhydra-2.2.
|
|
22
|
-
dbhydra-2.2.
|
|
23
|
-
dbhydra-2.2.
|
|
24
|
-
dbhydra-2.2.
|
|
25
|
-
dbhydra-2.2.
|
|
21
|
+
dbhydra-2.2.14.dist-info/LICENSE,sha256=k49Yga8CP889JJaHlOpGFzr_be2nqMoep2chYeIDctk,1091
|
|
22
|
+
dbhydra-2.2.14.dist-info/METADATA,sha256=wHpM3ajf_qqriw9t8HZUjAMw4R2R1OjrxZHgHJ9Z2j0,2299
|
|
23
|
+
dbhydra-2.2.14.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
|
24
|
+
dbhydra-2.2.14.dist-info/top_level.txt,sha256=oO4Gf1T8_txIsIlp11GI0k7PtBIMb9GRwb5ObF4MLVg,8
|
|
25
|
+
dbhydra-2.2.14.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|