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

Function ops_sql_api_update

modules/sqlops/sqlops_impl.c:868–889  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

866
867
868int ops_sql_api_update(struct db_url *url, struct sip_msg* msg, str *cols,
869 str *table, str *filter)
870{
871 cJSON *Jcols = NULL, *Jfilter;
872 int ret;
873
874 ret = _parse_json_col_and_filter( cols, filter, &Jcols, &Jfilter);
875 if (ret<0) {
876 LM_ERR("failed to JSON parse cols and filter\n");
877 } else {
878 ret = sql_api_update( url, msg, Jcols, table, Jfilter);
879 if (ret<0) {
880 LM_ERR("failed to perform DB update query\n");
881 } else {
882 ret =1;
883 }
884 }
885
886 if (Jcols) cJSON_Delete(Jcols);
887 if (Jfilter) cJSON_Delete(Jfilter);
888 return ret;
889}
890
891
892int ops_sql_api_insert(struct db_url *url, struct sip_msg* msg, str *table,

Callers 1

w_sql_updateFunction · 0.85

Calls 3

sql_api_updateFunction · 0.85
cJSON_DeleteFunction · 0.50

Tested by

no test coverage detected