MCPcopy Create free account
hub / github.com/aaPanel/BaoTa / execute

Method execute

class/db.py:602–613  ·  view source on GitHub ↗
(self,sql,param = ())

Source from the content-addressed store, hash-verified

600
601
602 def execute(self,sql,param = ()):
603 #执行SQL语句返回受影响行
604 self.write_lock()
605 self.clear_files()
606 self.__GetConn()
607 try:
608 result = self.__DB_CONN.execute(sql,self.__to_tuple(param))
609 self.__DB_CONN.commit()
610 self.rm_lock()
611 return result.rowcount
612 except Exception as ex:
613 return "error: " + str(ex)
614
615 def executemany(self, sql, param: list):
616 # 执行SQL语句返回受影响行

Callers 15

restore_site_db_dataMethod · 0.95
init_dbMethod · 0.95
create_logsFunction · 0.95
check_tablesMethod · 0.95
selectMethod · 0.95
sql_pacthFunction · 0.95
init_dbMethod · 0.95
create_logsFunction · 0.95
do_onceMethod · 0.45
task_table_repMethod · 0.45
do_oneMethod · 0.45
save_to_dbMethod · 0.45

Calls 6

write_lockMethod · 0.95
clear_filesMethod · 0.95
__GetConnMethod · 0.95
__to_tupleMethod · 0.95
rm_lockMethod · 0.95
commitMethod · 0.45

Tested by 1

test_sqlFunction · 0.36