velocity-python 0.0.105__py3-none-any.whl → 0.0.106__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.

Potentially problematic release.


This version of velocity-python might be problematic. Click here for more details.

@@ -56,10 +56,18 @@ class Result:
56
56
  def _fetch_first_row(self):
57
57
  """
58
58
  Pre-fetch the first row from the cursor to enable immediate boolean evaluation.
59
+ Only attempts to fetch for SELECT-like operations that return rows.
59
60
  """
60
61
  if self._first_row_fetched or not self._cursor:
61
62
  return
62
63
 
64
+ # Don't try to fetch from INSERT/UPDATE/DELETE operations
65
+ # These operations don't return rows, only rowcount
66
+ if self.__sql and self.__sql.strip().upper().startswith(('INSERT', 'UPDATE', 'DELETE', 'TRUNCATE')):
67
+ self._exhausted = True
68
+ self._first_row_fetched = True
69
+ return
70
+
63
71
  try:
64
72
  raw_row = self._cursor.fetchone()
65
73
  if raw_row:
velocity/db/core/table.py CHANGED
@@ -431,7 +431,7 @@ class Table:
431
431
  if kwds.get("sql_only", False):
432
432
  return sql, vals
433
433
  result = self.tx.execute(sql, vals, cursor=self.cursor())
434
- return result.cursor.rowcount
434
+ return result.cursor.rowcount if result.cursor else 0
435
435
 
436
436
  @reset_id_on_dup_key
437
437
  @create_missing
@@ -443,7 +443,7 @@ class Table:
443
443
  if kwds.get("sql_only", False):
444
444
  return sql, vals
445
445
  result = self.tx.execute(sql, vals, cursor=self.cursor())
446
- return result.cursor.rowcount
446
+ return result.cursor.rowcount if result.cursor else 0
447
447
 
448
448
  @reset_id_on_dup_key
449
449
  @create_missing
@@ -462,7 +462,7 @@ class Table:
462
462
  if kwds.get("sql_only", False):
463
463
  return sql, vals
464
464
  result = self.tx.execute(sql, vals, cursor=self.cursor())
465
- return result.cursor.rowcount
465
+ return result.cursor.rowcount if result.cursor else 0
466
466
 
467
467
  upsert = merge
468
468
  indate = merge
@@ -662,7 +662,7 @@ class Table:
662
662
  if kwds.get("sql_only", False):
663
663
  return sql, vals
664
664
  result = self.tx.execute(sql, vals)
665
- return result.cursor.rowcount
665
+ return result.cursor.rowcount if result.cursor else 0
666
666
 
667
667
  def truncate(self, **kwds):
668
668
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: velocity-python
3
- Version: 0.0.105
3
+ Version: 0.0.106
4
4
  Summary: A rapid application development library for interfacing with data storage
5
5
  Author-email: Velocity Team <info@codeclubs.org>
6
6
  License-Expression: MIT
@@ -20,10 +20,10 @@ velocity/db/core/database.py,sha256=3zNGItklu9tZCKsbx2T2vCcU1so8AL9PPL0DLjvaz6s,
20
20
  velocity/db/core/decorators.py,sha256=76Jkr9XptXt8cvcgp1zbHfuL8uHzWy8lwfR29u-DVu4,4574
21
21
  velocity/db/core/engine.py,sha256=iLQSr9hvn4w78EGiCbS2WsiojQgPYRBW_EGjTS2074g,49225
22
22
  velocity/db/core/exceptions.py,sha256=tuDniRqTX8Opc2d033LPJOI3Ux4NSwUcHqW729n-HXA,1027
23
- velocity/db/core/result.py,sha256=q5YvOP8_ozDdWJxLfFkGyEvF_ZqSn-WqI0qO5UgVBa4,12393
23
+ velocity/db/core/result.py,sha256=dgiOXH-iJXuDH4PbSTWVkn-heAkJQcXCC-gs0ZuqF94,12814
24
24
  velocity/db/core/row.py,sha256=zZ3zZbWjZkZfYAYuZJLHFJ8jdXc7dYv8Iyv9Ut8W8tE,7261
25
25
  velocity/db/core/sequence.py,sha256=VMBc0ZjGnOaWTwKW6xMNTdP8rZ2umQ8ml4fHTTwuGq4,3904
26
- velocity/db/core/table.py,sha256=yUZVKrQXgHBMWY5Mf-XmwgaNhW-HHqfg57PpUW_RXHQ,34586
26
+ velocity/db/core/table.py,sha256=oQFam6DwLnGiqa6v8Wys_yD_N4iWwfxGBwgLB5VUQSQ,34682
27
27
  velocity/db/core/transaction.py,sha256=unjmVkkfb7D8Wow6V8V8aLaxUZo316i--ksZxc4-I1Q,6613
28
28
  velocity/db/servers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
29
29
  velocity/db/servers/mysql.py,sha256=qHwlB_Mg02R7QFjD5QvJCorYYiP50CqEiQyZVl3uYns,20914
@@ -49,8 +49,8 @@ velocity/misc/tools.py,sha256=_bGneHHA_BV-kUonzw5H3hdJ5AOJRCKfzhgpkFbGqIo,1502
49
49
  velocity/misc/conv/__init__.py,sha256=MLYF58QHjzfDSxb1rdnmLnuEQCa3gnhzzZ30CwZVvQo,40
50
50
  velocity/misc/conv/iconv.py,sha256=d4_BucW8HTIkGNurJ7GWrtuptqUf-9t79ObzjJ5N76U,10603
51
51
  velocity/misc/conv/oconv.py,sha256=h5Lo05DqOQnxoD3y6Px_MQP_V-pBbWf8Hkgkb9Xp1jk,6032
52
- velocity_python-0.0.105.dist-info/licenses/LICENSE,sha256=aoN245GG8s9oRUU89KNiGTU4_4OtnNmVi4hQeChg6rM,1076
53
- velocity_python-0.0.105.dist-info/METADATA,sha256=TEKdozOuF6TjYw8yBGI57YZpr_bvGWAufFkdcRscBlI,34262
54
- velocity_python-0.0.105.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
55
- velocity_python-0.0.105.dist-info/top_level.txt,sha256=JW2vJPmodgdgSz7H6yoZvnxF8S3fTMIv-YJWCT1sNW0,9
56
- velocity_python-0.0.105.dist-info/RECORD,,
52
+ velocity_python-0.0.106.dist-info/licenses/LICENSE,sha256=aoN245GG8s9oRUU89KNiGTU4_4OtnNmVi4hQeChg6rM,1076
53
+ velocity_python-0.0.106.dist-info/METADATA,sha256=2KmlGjeomKYirsh2YHunDlWp2ePlcMlNfxOLtAb0tcg,34262
54
+ velocity_python-0.0.106.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
55
+ velocity_python-0.0.106.dist-info/top_level.txt,sha256=JW2vJPmodgdgSz7H6yoZvnxF8S3fTMIv-YJWCT1sNW0,9
56
+ velocity_python-0.0.106.dist-info/RECORD,,