* Fill the structure with data from database */
| 405 | * Fill the structure with data from database |
| 406 | */ |
| 407 | int db_sqlite_convert_result(const db_con_t* _h, db_res_t* _r) |
| 408 | { |
| 409 | if ((!_h) || (!_r)) { |
| 410 | LM_ERR("invalid parameter\n"); |
| 411 | return -1; |
| 412 | } |
| 413 | |
| 414 | if (db_sqlite_get_columns(_h, _r) < 0) { |
| 415 | LM_ERR("error while getting column names\n"); |
| 416 | return -2; |
| 417 | } |
| 418 | |
| 419 | if (db_sqlite_convert_rows(_h, _r) < 0) { |
| 420 | LM_ERR("error while converting rows\n"); |
| 421 | db_free_columns(_r); |
| 422 | return -3; |
| 423 | } |
| 424 | |
| 425 | return 0; |
| 426 | } |
| 427 | |
| 428 | #undef DWORD |
no test coverage detected