database-wrapper-mysql 0.1.73__py3-none-any.whl → 0.1.75__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.
- database_wrapper_mysql/connector.py +18 -0
- {database_wrapper_mysql-0.1.73.dist-info → database_wrapper_mysql-0.1.75.dist-info}/METADATA +3 -3
- database_wrapper_mysql-0.1.75.dist-info/RECORD +8 -0
- {database_wrapper_mysql-0.1.73.dist-info → database_wrapper_mysql-0.1.75.dist-info}/WHEEL +1 -1
- database_wrapper_mysql-0.1.73.dist-info/RECORD +0 -8
- {database_wrapper_mysql-0.1.73.dist-info → database_wrapper_mysql-0.1.75.dist-info}/top_level.txt +0 -0
|
@@ -35,6 +35,10 @@ class MySQL(DatabaseBackend):
|
|
|
35
35
|
connection: MySqlConnection
|
|
36
36
|
cursor: MySqlDictCursor
|
|
37
37
|
|
|
38
|
+
##################
|
|
39
|
+
### Connection ###
|
|
40
|
+
##################
|
|
41
|
+
|
|
38
42
|
def open(self) -> None:
|
|
39
43
|
# Free resources
|
|
40
44
|
if hasattr(self, "connection") and self.connection:
|
|
@@ -79,6 +83,20 @@ class MySQL(DatabaseBackend):
|
|
|
79
83
|
# TODO: Typings issue
|
|
80
84
|
self.cursor = self.connection.cursor(MySqlDictCursor) # type: ignore
|
|
81
85
|
|
|
86
|
+
def ping(self) -> bool:
|
|
87
|
+
try:
|
|
88
|
+
self.cursor.execute("SELECT 1")
|
|
89
|
+
self.cursor.fetchone()
|
|
90
|
+
except Exception as e:
|
|
91
|
+
self.logger.debug(f"Error while pinging the database: {e}")
|
|
92
|
+
return False
|
|
93
|
+
|
|
94
|
+
return True
|
|
95
|
+
|
|
96
|
+
############
|
|
97
|
+
### Data ###
|
|
98
|
+
############
|
|
99
|
+
|
|
82
100
|
def lastInsertId(self) -> int:
|
|
83
101
|
assert self.cursor, "Cursor is not initialized"
|
|
84
102
|
return self.cursor.lastrowid
|
{database_wrapper_mysql-0.1.73.dist-info → database_wrapper_mysql-0.1.75.dist-info}/METADATA
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: database_wrapper_mysql
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.75
|
|
4
4
|
Summary: database_wrapper for MySQL database
|
|
5
5
|
Author-email: Gints Murans <gm@gm.lv>
|
|
6
6
|
License: GNU General Public License v3.0 (GPL-3.0)
|
|
@@ -32,7 +32,7 @@ Classifier: Topic :: Software Development
|
|
|
32
32
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
33
33
|
Requires-Python: >=3.8
|
|
34
34
|
Description-Content-Type: text/markdown
|
|
35
|
-
Requires-Dist: database_wrapper==0.1.
|
|
35
|
+
Requires-Dist: database_wrapper==0.1.75
|
|
36
36
|
Requires-Dist: mysqlclient>=2.2.2
|
|
37
37
|
|
|
38
38
|
# database_wrapper_mysql
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
database_wrapper_mysql/__init__.py,sha256=C_6Z9sbuvVF3Oy4xMlsekryRUZpReyOx0IhO-OCMVHY,649
|
|
2
|
+
database_wrapper_mysql/connector.py,sha256=w_YFPesqXnqd0BH6mnSeOQT6llD82mDtwQPdKB_foUs,3741
|
|
3
|
+
database_wrapper_mysql/db_wrapper_mysql.py,sha256=t_FETaox5IR_v9ThG2ImMYM0mXPt3yGexwmVVp0bWlY,2007
|
|
4
|
+
database_wrapper_mysql/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
|
+
database_wrapper_mysql-0.1.75.dist-info/METADATA,sha256=2XBvXdaLK16hGVAwzwAtqN7xP1ynxlWX2VOAeOHTEdk,2870
|
|
6
|
+
database_wrapper_mysql-0.1.75.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
|
|
7
|
+
database_wrapper_mysql-0.1.75.dist-info/top_level.txt,sha256=hYkDzASh4xmHyKkhvI7Dy7QNkBoBGy-_dSPFdAo3QcQ,23
|
|
8
|
+
database_wrapper_mysql-0.1.75.dist-info/RECORD,,
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
database_wrapper_mysql/__init__.py,sha256=C_6Z9sbuvVF3Oy4xMlsekryRUZpReyOx0IhO-OCMVHY,649
|
|
2
|
-
database_wrapper_mysql/connector.py,sha256=2uSD1mhKOrCQ3deCLfThYMlQ5P9pxhPCSzppL6_-C-4,3349
|
|
3
|
-
database_wrapper_mysql/db_wrapper_mysql.py,sha256=t_FETaox5IR_v9ThG2ImMYM0mXPt3yGexwmVVp0bWlY,2007
|
|
4
|
-
database_wrapper_mysql/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
|
-
database_wrapper_mysql-0.1.73.dist-info/METADATA,sha256=WkNg_23Ur1l-44WhVefGsUdT2o5zw1aLMhYK_wAT37k,2870
|
|
6
|
-
database_wrapper_mysql-0.1.73.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
|
7
|
-
database_wrapper_mysql-0.1.73.dist-info/top_level.txt,sha256=hYkDzASh4xmHyKkhvI7Dy7QNkBoBGy-_dSPFdAo3QcQ,23
|
|
8
|
-
database_wrapper_mysql-0.1.73.dist-info/RECORD,,
|
{database_wrapper_mysql-0.1.73.dist-info → database_wrapper_mysql-0.1.75.dist-info}/top_level.txt
RENAMED
|
File without changes
|