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

Method query

class/db.py:238–253  ·  view source on GitHub ↗
(self, sql, param=(), transfer_list=True)

Source from the content-addressed store, hash-verified

236 return self
237
238 def query(self, sql, param=(), transfer_list=True):
239 self.ERR_INFO = None
240 # 执行SQL语句返回数据集
241 self.__GetConn()
242 try:
243 result = self.__DB_CONN.execute(sql, self.__to_tuple(param))
244 # self.log("result:" + str(result))
245 if transfer_list:
246 # 将元组转换成列表
247 data = list(map(list, result))
248 else:
249 data = result
250 return data
251 except Exception as ex:
252 self.ERR_INFO = str(ex)
253 return "error: " + str(ex)
254 def query(self,sql,param = ()):
255 self.ERR_INFO = None
256 #执行SQL语句返回数据集

Callers 15

check_tablesMethod · 0.95
__get_columnsMethod · 0.95
get_table_infoFunction · 0.45
check_exists_tableFunction · 0.45
sync_db_tableFunction · 0.45
repair_dbFunction · 0.45
sync_db_allFunction · 0.45
get_sql_shellFunction · 0.45
check_default_errorFunction · 0.45
check_disk_usedFunction · 0.45
ErFunction · 0.45
CheckCloudDatabaseMethod · 0.45

Calls 5

__GetConnMethod · 0.95
__to_tupleMethod · 0.95
clear_filesMethod · 0.95
mapFunction · 0.85
executeMethod · 0.45

Tested by

no test coverage detected