database-wrapper-mysql 0.2.32__tar.gz → 0.2.36__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_mysql
3
- Version: 0.2.32
3
+ Version: 0.2.36
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.2.32
35
+ Requires-Dist: database_wrapper==0.2.36
36
36
  Requires-Dist: mysqlclient>=2.2.2
37
37
 
38
38
  # database_wrapper_mysql
@@ -34,8 +34,8 @@ class Mysql(DatabaseBackend):
34
34
 
35
35
  Defaults:
36
36
  port = 0 - See comment below
37
- charset = utf8
38
- collation = utf8_general_ci
37
+ charset = utf8mb4
38
+ collation = utf8mb4_general_ci
39
39
  """
40
40
 
41
41
  config: MysqlConfig
@@ -56,11 +56,12 @@ class Mysql(DatabaseBackend):
56
56
  if "port" not in self.config or not self.config["port"]:
57
57
  self.config["port"] = 0
58
58
 
59
+ # utf8 is an alias for utf8mb3, which cannot store 4-byte characters (e.g. emoji)
59
60
  if "charset" not in self.config or not self.config["charset"]:
60
- self.config["charset"] = "utf8"
61
+ self.config["charset"] = "utf8mb4"
61
62
 
62
63
  if "collation" not in self.config or not self.config["collation"]:
63
- self.config["collation"] = "utf8_general_ci"
64
+ self.config["collation"] = "utf8mb4_general_ci"
64
65
 
65
66
  if "kwargs" not in self.config or not self.config["kwargs"]:
66
67
  self.config["kwargs"] = {}
@@ -12,6 +12,9 @@ class DBWrapperMysql(DBWrapper):
12
12
  db_cursor: MysqlTypedDictCursor | None
13
13
  """ MySQL cursor object """
14
14
 
15
+ insert_returning = False
16
+ """ MySQL has no INSERT ... RETURNING (MariaDB only); use lastrowid instead """
17
+
15
18
  #######################
16
19
  ### Class lifecycle ###
17
20
  #######################
@@ -73,4 +76,4 @@ class DBWrapperMysql(DBWrapper):
73
76
  def limit_query(self, offset: int = 0, limit: int = 100) -> str | None:
74
77
  if limit == 0:
75
78
  return None
76
- return f"LIMIT {offset},{limit}"
79
+ return f"LIMIT {int(offset)},{int(limit)}"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: database_wrapper_mysql
3
- Version: 0.2.32
3
+ Version: 0.2.36
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.2.32
35
+ Requires-Dist: database_wrapper==0.2.36
36
36
  Requires-Dist: mysqlclient>=2.2.2
37
37
 
38
38
  # database_wrapper_mysql
@@ -0,0 +1,2 @@
1
+ database_wrapper==0.2.36
2
+ mysqlclient>=2.2.2
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "database_wrapper_mysql"
7
- version = "0.2.32"
7
+ version = "0.2.36"
8
8
  description = "database_wrapper for MySQL database"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.8"
@@ -32,7 +32,7 @@ classifiers = [
32
32
  "Topic :: Software Development :: Libraries :: Python Modules",
33
33
  ]
34
34
  keywords = ["database", "wrapper", "python", "mysql", "mariadb"]
35
- dependencies = ["database_wrapper == 0.2.32", "mysqlclient >= 2.2.2"]
35
+ dependencies = ["database_wrapper == 0.2.36", "mysqlclient >= 2.2.2"]
36
36
 
37
37
  [project.urls]
38
38
  Homepage = "https://github.com/gintsmurans/py_database_wrapper"
@@ -1,2 +0,0 @@
1
- database_wrapper==0.2.32
2
- mysqlclient>=2.2.2