database-wrapper-mssql 0.1.85__tar.gz → 0.2.2__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.4
2
2
  Name: database_wrapper_mssql
3
- Version: 0.1.85
3
+ Version: 0.2.2
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.85
35
+ Requires-Dist: database_wrapper==0.2.2
36
36
  Requires-Dist: pymssql>=2.2.10
37
37
 
38
38
  # database_wrapper_mssql
@@ -61,8 +61,8 @@ class MSSQL(DatabaseBackend):
61
61
  port=self.config["port"],
62
62
  tds_version="7.0",
63
63
  as_dict=True,
64
- timeout=self.connectionTimeout,
65
- login_timeout=self.connectionTimeout,
64
+ timeout=self.connection_timeout,
65
+ login_timeout=self.connection_timeout,
66
66
  **self.config["kwargs"],
67
67
  )
68
68
  self.cursor = self.connection.cursor(as_dict=True)
@@ -81,11 +81,11 @@ class MSSQL(DatabaseBackend):
81
81
  ### Data ###
82
82
  ############
83
83
 
84
- def lastInsertId(self) -> int:
84
+ def last_insert_id(self) -> int:
85
85
  assert self.cursor, "Cursor is not initialized"
86
86
  return self.cursor.lastrowid
87
87
 
88
- def affectedRows(self) -> int:
88
+ def affected_rows(self) -> int:
89
89
  assert self.cursor, "Cursor is not initialized"
90
90
  return self.cursor.rowcount
91
91
 
@@ -8,7 +8,7 @@ from .connector import MssqlCursor
8
8
  class DBWrapperMSSQL(DBWrapper):
9
9
  """Database wrapper for mssql database"""
10
10
 
11
- dbCursor: MssqlCursor | None
11
+ db_cursor: MssqlCursor | None
12
12
  """ MsSQL cursor object """
13
13
 
14
14
  #######################
@@ -19,38 +19,39 @@ class DBWrapperMSSQL(DBWrapper):
19
19
  # We are overriding the __init__ method for the type hinting
20
20
  def __init__(
21
21
  self,
22
- dbCursor: MssqlCursor | None = None,
22
+ db_cursor: MssqlCursor | None = None,
23
23
  logger: logging.Logger | None = None,
24
24
  ):
25
25
  """
26
26
  Initializes a new instance of the DBWrapper class.
27
27
 
28
28
  Args:
29
- dbCursor (MssqlCursor): The MsSQL database cursor object.
29
+ db_cursor (MssqlCursor): The MsSQL database cursor object.
30
30
  logger (logging.Logger, optional): The logger object. Defaults to None.
31
31
  """
32
- super().__init__(dbCursor, logger)
32
+ super().__init__(db_cursor, logger)
33
33
 
34
34
  ###############
35
35
  ### Setters ###
36
36
  ###############
37
37
 
38
- def setDbCursor(self, dbCursor: MssqlCursor | None) -> None:
38
+ def set_db_cursor(self, db_cursor: MssqlCursor | None) -> None:
39
39
  """
40
40
  Updates the database cursor object.
41
41
 
42
42
  Args:
43
- dbCursor (MssqlCursor): The new database cursor object.
43
+ db_cursor (MssqlCursor): The new database cursor object.
44
44
  """
45
- super().setDbCursor(dbCursor)
45
+ super().set_db_cursor(db_cursor)
46
46
 
47
47
  #####################
48
48
  ### Query methods ###
49
49
  #####################
50
50
 
51
- def limitQuery(self, offset: int = 0, limit: int = 100) -> str | None:
51
+ def limit_query(self, offset: int = 0, limit: int = 100) -> str | None:
52
52
  if limit == 0:
53
53
  return None
54
+
54
55
  return f"""
55
56
  OFFSET {offset} ROWS
56
57
  FETCH NEXT {limit} ROWS ONLY
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: database_wrapper_mssql
3
- Version: 0.1.85
3
+ Version: 0.2.2
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.85
35
+ Requires-Dist: database_wrapper==0.2.2
36
36
  Requires-Dist: pymssql>=2.2.10
37
37
 
38
38
  # database_wrapper_mssql
@@ -0,0 +1,2 @@
1
+ database_wrapper==0.2.2
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.85"
7
+ version = "0.2.2"
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.85",
38
+ "database_wrapper == 0.2.2",
39
39
  "pymssql >= 2.2.10",
40
40
  ]
41
41
 
@@ -1,2 +0,0 @@
1
- database_wrapper==0.1.85
2
- pymssql>=2.2.10