database-wrapper-mssql 0.1.73__tar.gz → 0.1.74__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: database_wrapper_mssql
3
- Version: 0.1.73
3
+ Version: 0.1.74
4
4
  Summary: database_wrapper for MSSQL 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.73
35
+ Requires-Dist: database_wrapper==0.1.74
36
36
  Requires-Dist: pymssql>=2.2.10
37
37
 
38
38
  # database_wrapper_mssql
@@ -36,6 +36,10 @@ class MSSQL(DatabaseBackend):
36
36
  connection: MssqlConnection
37
37
  cursor: MssqlCursor
38
38
 
39
+ ##################
40
+ ### Connection ###
41
+ ##################
42
+
39
43
  def open(self) -> None:
40
44
  self.logger.debug("Connecting to DB")
41
45
 
@@ -63,6 +67,20 @@ class MSSQL(DatabaseBackend):
63
67
  )
64
68
  self.cursor = self.connection.cursor(as_dict=True)
65
69
 
70
+ def ping(self) -> bool:
71
+ try:
72
+ self.cursor.execute("SELECT 1")
73
+ self.cursor.fetchone()
74
+ except Exception as e:
75
+ self.logger.debug(f"Error while pinging the database: {e}")
76
+ return False
77
+
78
+ return True
79
+
80
+ ############
81
+ ### Data ###
82
+ ############
83
+
66
84
  def lastInsertId(self) -> int:
67
85
  assert self.cursor, "Cursor is not initialized"
68
86
  return self.cursor.lastrowid
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: database_wrapper_mssql
3
- Version: 0.1.73
3
+ Version: 0.1.74
4
4
  Summary: database_wrapper for MSSQL 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.73
35
+ Requires-Dist: database_wrapper==0.1.74
36
36
  Requires-Dist: pymssql>=2.2.10
37
37
 
38
38
  # database_wrapper_mssql
@@ -0,0 +1,2 @@
1
+ database_wrapper==0.1.74
2
+ pymssql>=2.2.10
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "database_wrapper_mssql"
7
- version = "0.1.73"
7
+ version = "0.1.74"
8
8
  description = "database_wrapper for MSSQL database"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.8"
@@ -35,7 +35,7 @@ classifiers = [
35
35
  ]
36
36
  keywords = ["database", "wrapper", "python", "mssql", "sqlserver"]
37
37
  dependencies = [
38
- "database_wrapper == 0.1.73",
38
+ "database_wrapper == 0.1.74",
39
39
  "pymssql >= 2.2.10",
40
40
  ]
41
41
 
@@ -1,2 +0,0 @@
1
- database_wrapper==0.1.73
2
- pymssql>=2.2.10