MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / ops_sql_api_select

Function ops_sql_api_select

modules/sqlops/sqlops_impl.c:843–865  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

841
842
843int ops_sql_api_select(struct db_url *url, struct sip_msg* msg, str *cols,
844 str *table, str *filter, str * order, pvname_list_t* dest, int one_col)
845{
846 cJSON *Jcols = NULL, *Jfilter;
847 int ret;
848
849 ret = _parse_json_col_and_filter( cols, filter, &Jcols, &Jfilter);
850 if (ret<0) {
851 LM_ERR("failed to JSON parse cols and filter\n");
852 } else {
853 ret = sql_api_select( url, msg, Jcols, table, Jfilter,
854 order, dest, one_col);
855 if (ret<0) {
856 LM_ERR("failed to perform DB select query\n");
857 } else {
858 ret =1;
859 }
860 }
861
862 if (Jcols) cJSON_Delete(Jcols);
863 if (Jfilter) cJSON_Delete(Jfilter);
864 return ret;
865}
866
867
868int ops_sql_api_update(struct db_url *url, struct sip_msg* msg, str *cols,

Callers 2

w_sql_selectFunction · 0.85
w_sql_select_oneFunction · 0.85

Calls 3

sql_api_selectFunction · 0.85
cJSON_DeleteFunction · 0.50

Tested by

no test coverage detected