MCPcopy Create free account
hub / github.com/dbcli/mycli / get_warning_count

Function get_warning_count

mycli/packages/special/utils.py:77–90  ·  view source on GitHub ↗
(cur: Cursor)

Source from the content-addressed store, hash-verified

75
76
77def get_warning_count(cur: Cursor) -> int:
78 query = 'SHOW COUNT(*) WARNINGS'
79 logger.debug(query)
80
81 warning_count = 0
82
83 try:
84 cur.execute(query)
85 if one := cur.fetchone():
86 warning_count = int(one[0] or 0)
87 except pymysql.err.OperationalError:
88 pass
89
90 return warning_count
91
92
93def get_ssl_version(cur: Cursor) -> str | None:

Calls 3

debugMethod · 0.45
executeMethod · 0.45
fetchoneMethod · 0.45