MCPcopy Create free account
hub / github.com/Boris-code/feapder / execute

Method execute

feapder/db/mysqldb.py:384–409  ·  view source on GitHub ↗

Args: sql: Returns: 影响行数

(self, sql)

Source from the content-addressed store, hash-verified

382 return affect_count
383
384 def execute(self, sql) -> int:
385 """
386
387 Args:
388 sql:
389
390 Returns: 影响行数
391 """
392 affect_count = None
393 conn, cursor = None, None
394 try:
395 conn, cursor = self.get_connection()
396 affect_count = cursor.execute(sql)
397 conn.commit()
398 except Exception as e:
399 log.error(
400 """
401 error:%s
402 sql: %s
403 """
404 % (e, sql)
405 )
406 finally:
407 self.close_connection(conn, cursor)
408
409 return affect_count

Callers 15

chrome_driverMethod · 0.80
edge_driverMethod · 0.80
createMethod · 0.80
_create_userbaseMethod · 0.80
findMethod · 0.80
addMethod · 0.80
updateMethod · 0.80
deleteMethod · 0.80
saddMethod · 0.80
sgetMethod · 0.80
sremMethod · 0.80

Calls 3

get_connectionMethod · 0.95
close_connectionMethod · 0.95
errorMethod · 0.80

Tested by

no test coverage detected