** Run the SQL statement in zSql. Or if doing a --dryrun, merely print it out. */
| 16608 | ** Run the SQL statement in zSql. Or if doing a --dryrun, merely print it out. |
| 16609 | */ |
| 16610 | static int arExecSql(ArCommand *pAr, const char *zSql){ |
| 16611 | int rc; |
| 16612 | if( pAr->bDryRun ){ |
| 16613 | utf8_printf(pAr->p->out, "%s\n", zSql); |
| 16614 | rc = SQLITE_OK; |
| 16615 | }else{ |
| 16616 | char *zErr = 0; |
| 16617 | rc = sqlite3_exec(pAr->db, zSql, 0, 0, &zErr); |
| 16618 | if( zErr ){ |
| 16619 | utf8_printf(stdout, "ERROR: %s\n", zErr); |
| 16620 | sqlite3_free(zErr); |
| 16621 | } |
| 16622 | } |
| 16623 | return rc; |
| 16624 | } |
| 16625 | |
| 16626 | |
| 16627 | /* |
no test coverage detected