** Run the SQL statement in zSql. Or if doing a --dryrun, merely print it out. */
| 22415 | ** Run the SQL statement in zSql. Or if doing a --dryrun, merely print it out. |
| 22416 | */ |
| 22417 | static int arExecSql(ArCommand *pAr, const char *zSql){ |
| 22418 | int rc; |
| 22419 | if( pAr->bDryRun ){ |
| 22420 | utf8_printf(pAr->p->out, "%s\n", zSql); |
| 22421 | rc = SQLITE_OK; |
| 22422 | }else{ |
| 22423 | char *zErr = 0; |
| 22424 | rc = sqlite3_exec(pAr->db, zSql, 0, 0, &zErr); |
| 22425 | if( zErr ){ |
| 22426 | utf8_printf(stdout, "ERROR: %s\n", zErr); |
| 22427 | sqlite3_free(zErr); |
| 22428 | } |
| 22429 | } |
| 22430 | return rc; |
| 22431 | } |
| 22432 | |
| 22433 | |
| 22434 | /* |
no test coverage detected