mySQLDBCtrlAPI 1.2510.23__tar.gz → 1.2510.26__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.

Potentially problematic release.


This version of mySQLDBCtrlAPI might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mySQLDBCtrlAPI
3
- Version: 1.2510.23
3
+ Version: 1.2510.26
4
4
  Summary: mySQLDBCtrlAPI Python package
5
5
  Author-email: James Lin <tylin123@ms27.hinet.net>
6
6
  License: Copyright (c) 2025 James Lin
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "mySQLDBCtrlAPI"
7
- version = "1.2510.23"
7
+ version = "1.2510.26"
8
8
  description = "mySQLDBCtrlAPI Python package"
9
9
  authors = [
10
10
  { name="James Lin", email="tylin123@ms27.hinet.net" }
@@ -136,6 +136,8 @@ class CLASS_mySQLDBCtrl:
136
136
  # 傳回: obj_Query
137
137
  # ----------------------------------------------------------------------
138
138
  def CUF_DB_OpenSQL(self, Pobj_Connection, Pms_SQL):
139
+ obj_DataSet: Any;
140
+
139
141
  Pobj_Connection.commit();
140
142
  # ------------------------------------------------------------
141
143
  obj_Query = Pobj_Connection.cursor();
@@ -147,11 +149,13 @@ class CLASS_mySQLDBCtrl:
147
149
  self.CVmi_qryRECCNT = self.CUF_DB_RecordCount(obj_Query);
148
150
  # ------------------------------------------------------------
149
151
  if(self.CVmi_qryRECCNT > 0):
150
- self.CUF_DB_Next(obj_Query);
152
+ obj_DataSet = self.CUF_DB_Next(obj_Query);
151
153
  # ------------------------------------------------------------
152
- return(obj_Query);
154
+ return(obj_Query, obj_DataSet);
153
155
  # ----------------------------------------------------------------------
154
156
  def CUF_DB_OpenSQL_utf8(self, Pobj_Connection, Pms_SQL):
157
+ obj_DataSet: Any;
158
+
155
159
  Pobj_Connection.commit();
156
160
  # ------------------------------------------------------------
157
161
  obj_Query = Pobj_Connection.cursor();
@@ -163,13 +167,13 @@ class CLASS_mySQLDBCtrl:
163
167
  self.CVmi_qryRECCNT = self.CUF_DB_RecordCount(obj_Query);
164
168
  # ------------------------------------------------------------
165
169
  if(self.CVmi_qryRECCNT > 0):
166
- self.CUF_DB_Next(obj_Query);
170
+ obj_DataSet = self.CUF_DB_Next(obj_Query);
167
171
  # ------------------------------------------------------------
168
- return(obj_Query);
172
+ return(obj_Query, obj_DataSet);
169
173
 
170
174
 
171
175
  # ----------------------------------------------------------------------
172
- # 功能: 擷取資料錄
176
+ # 功能: 擷取資料錄 (下一筆)
173
177
  # 傳入:
174
178
  # 傳回: obj_Field
175
179
  # ----------------------------------------------------------------------
@@ -179,7 +183,10 @@ class CLASS_mySQLDBCtrl:
179
183
  return(Pobj_Query.fetchone());
180
184
  # ----------------------------------------------------------------------
181
185
  def CUF_DB_Next(self, Pobj_Query):
182
- self.CUF_DB_FETCH(Pobj_Query);
186
+ return(self.CUF_DB_FETCH(Pobj_Query));
187
+ # ----------------------------------------------------------------------
188
+ def CUF_Next(self, Pobj_Query):
189
+ return(self.CUF_DB_FETCH(Pobj_Query));
183
190
 
184
191
 
185
192
  # ----------------------------------------------------------------------
@@ -250,6 +257,10 @@ class CLASS_mySQLDBCtrl:
250
257
  # ----------------------------------------------------------------------
251
258
  def CUF_str_utf8(self, Pobj_DataSet):
252
259
  return(str(Pobj_DataSet).encode("latin1").decode("big5"));
260
+ # ----------------------------------------------------------------------
261
+ def CUF_utf8(self, Pobj_DataSet):
262
+ return(str(Pobj_DataSet).encode("latin1").decode("big5"));
263
+
253
264
 
254
265
  # ----------------------------------------------------------------------
255
266
  # 功能: 轉換字串編碼 (utf-8 -> big5)
@@ -259,6 +270,9 @@ class CLASS_mySQLDBCtrl:
259
270
  # ----------------------------------------------------------------------
260
271
  def CUF_str_big5(self, Pobj_DataSet):
261
272
  return(str(Pobj_DataSet).encode("big5").decode("latin1"));
273
+ # ----------------------------------------------------------------------
274
+ def CUF_big5(self, Pobj_DataSet):
275
+ return(str(Pobj_DataSet).encode("big5").decode("latin1"));
262
276
 
263
277
 
264
278
  # ----------------------------------------------------------------------
@@ -277,6 +291,9 @@ class CLASS_mySQLDBCtrl:
277
291
  # --------------------------------------------------
278
292
  with open(Pms_FileName, "wb") as obj_FP:
279
293
  obj_FP.write(obj_FileData);
294
+ # ----------------------------------------------------------------------
295
+ def CUF_GET_Blob(self, Pobj_Query, Pms_BlobFieldName, Pms_FileName):
296
+ self.CUF_GetBlobField(Pobj_Query, Pms_BlobFieldName, Pms_FileName);
280
297
 
281
298
 
282
299
  # ----------------------------------------------------------------------
@@ -301,7 +318,10 @@ class CLASS_mySQLDBCtrl:
301
318
  Pobj_Query.execute(ms_SQL, (obj_FileData,));
302
319
  # --------------------------------------------------
303
320
  self.CUobj_Conn.commit();
304
-
321
+ # ----------------------------------------------------------------------
322
+ def CUF_SET_BLOB(self, Pobj_Query, Pms_TableName, Pms_QUERY, Pms_BlobFieldName, Pms_FileName):
323
+ self.CUF_SetBlobField(Pobj_Query, Pms_TableName, Pms_QUERY, Pms_BlobFieldName, Pms_FileName);
324
+
305
325
 
306
326
  # --------------------------------------------------------------------------------
307
327
  # FUNC: 取得伺服主機系統日期時間
@@ -444,4 +464,16 @@ if(__name__ == '__main__'):
444
464
  ms_SQL = "SELECT * FROM _def_fileservicemedia_d "\
445
465
  " WHERE FolderType=1 AND MEDIAID=1 AND BlockID=1 ";
446
466
  obj_Query = Gobj_mySQLDBCtrl.CUF_DB_OpenSQL(Gobj_Conn, ms_SQL);
447
- Gobj_mySQLDBCtrl.CUF_GetBlobField(obj_Query, "Media_Block", "C:\\temp\\PPPKKK.zip");
467
+ Gobj_mySQLDBCtrl.CUF_GetBlobField(obj_Query, "Media_Block", "C:\\temp\\PPPKKK.zip");
468
+
469
+ # ----------------------------------------------------------------------
470
+ ms_SQL = "SELECT * From sysuserinfo ORDER BY USERID ";
471
+ obj_ZQuery, obj_DataSet = obj_mySQLDBCtrl.CUF_DB_OpenSQL(obj_ZConn, ms_SQL);
472
+
473
+ while not obj_mySQLDBCtrl.CUF_DB_Eof(obj_ZQuery):
474
+ print("USERID="+ obj_mySQLDBCtrl.CUF_utf8(obj_DataSet["LOGIN"]));
475
+ print("PASSWD="+ obj_mySQLDBCtrl.CUF_utf8(obj_DataSet["PASSWD"]));
476
+ obj_DataSet = obj_mySQLDBCtrl.CUF_Next(obj_ZQuery);
477
+
478
+
479
+
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mySQLDBCtrlAPI
3
- Version: 1.2510.23
3
+ Version: 1.2510.26
4
4
  Summary: mySQLDBCtrlAPI Python package
5
5
  Author-email: James Lin <tylin123@ms27.hinet.net>
6
6
  License: Copyright (c) 2025 James Lin