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

Function id2db_url

modules/sqlops/sqlops.c:349–375  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

347
348
349static int id2db_url(int id, int require_raw_query, int is_async,
350 struct db_url** url)
351{
352
353 *url = get_db_url((unsigned int)id);
354 if (*url==NULL) {
355 LM_ERR("no db_url with id <%d>\n", id);
356 return E_CFG;
357 }
358
359 /*
360 * Since mod_init() is run before function fixups, all DB structs
361 * are initialized and all DB capabilities are populated
362 */
363 if (require_raw_query && !DB_CAPABILITY((*url)->dbf, DB_CAP_RAW_QUERY)) {
364 LM_ERR("driver for DB URL [%u] does not support raw queries\n",
365 (unsigned int)id);
366 return -1;
367 }
368
369 if (is_async && !DB_CAPABILITY((*url)->dbf, DB_CAP_ASYNC_RAW_QUERY))
370 LM_WARN("async() calls for DB URL [%u] will work "
371 "in normal mode due to driver limitations\n",
372 (unsigned int)id);
373
374 return 0;
375}
376
377
378static int fixup_db_url(void ** param)

Callers 2

fixup_db_urlFunction · 0.85
fixup_db_idFunction · 0.85

Calls 1

get_db_urlFunction · 0.85

Tested by

no test coverage detected