MCPcopy
hub / github.com/1Panel-dev/MaxKB / native_search

Function native_search

apps/common/db/search.py:110–129  ·  view source on GitHub ↗

复杂查询 :param with_table_name: 生成sql是否包含表名 :param queryset: 查询条件构造器 :param select_string: 查询前缀 不包括 where limit 等信息 :param field_replace_dict: 需要替换的字段 :param with_search_one: 查询 :return: 查询结果

(queryset: QuerySet | Dict[str, QuerySet], select_string: str,
                  field_replace_dict: None | Dict[str, Dict[str, str]] | Dict[str, str] = None,
                  with_search_one=False, with_table_name=False)

Source from the content-addressed store, hash-verified

108
109
110def native_search(queryset: QuerySet | Dict[str, QuerySet], select_string: str,
111 field_replace_dict: None | Dict[str, Dict[str, str]] | Dict[str, str] = None,
112 with_search_one=False, with_table_name=False):
113 """
114 复杂查询
115 :param with_table_name: 生成sql是否包含表名
116 :param queryset: 查询条件构造器
117 :param select_string: 查询前缀 不包括 where limit 等信息
118 :param field_replace_dict: 需要替换的字段
119 :param with_search_one: 查询
120 :return: 查询结果
121 """
122 if isinstance(queryset, Dict):
123 exec_sql, exec_params = generate_sql_by_query_dict(queryset, select_string, field_replace_dict, with_table_name)
124 else:
125 exec_sql, exec_params = generate_sql_by_query(queryset, select_string, field_replace_dict, with_table_name)
126 if with_search_one:
127 return select_one(exec_sql, exec_params)
128 else:
129 return select_list(exec_sql, exec_params)
130
131
132def native_update(queryset: QuerySet | Dict[str, QuerySet], select_string: str,

Callers 15

get_toolsMethod · 0.90
get_toolsMethod · 0.90
listMethod · 0.90
listMethod · 0.90
listMethod · 0.90
list_paragraphMethod · 0.90
listMethod · 0.90
listMethod · 0.90
oneMethod · 0.90
export_excelMethod · 0.90

Calls 4

select_oneFunction · 0.90
select_listFunction · 0.90
generate_sql_by_queryFunction · 0.85

Tested by

no test coverage detected