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

Method execute

class/projectModel/totle_db.py:296–306  ·  view source on GitHub ↗
(self, sql, param=())

Source from the content-addressed store, hash-verified

294 return "error: " + str(ex)
295
296 def execute(self, sql, param=()):
297 # 执行SQL语句返回受影响行
298 self.write_lock()
299 self.__GetConn()
300 try:
301 result = self.__DB_CONN.execute(sql, self.__to_tuple(param))
302 self.__DB_CONN.commit()
303 self.rm_lock()
304 return result.rowcount
305 except Exception as ex:
306 return "error: " + str(ex)
307
308 # 是否有锁
309 def is_lock(self):

Callers 15

_init_msg_dbFunction · 0.95
init_dbFunction · 0.95
init_dbFunction · 0.95
alter_tableMethod · 0.45
del_containerMethod · 0.45
docker_splitMethod · 0.45
check_remark_tableMethod · 0.45
_create_db_schemaMethod · 0.45
load_dir_recordMethod · 0.45
save_dir_recordMethod · 0.45
GetSqlMethod · 0.45
selectMethod · 0.45

Calls 5

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

Tested by

no test coverage detected