MCPcopy Create free account
hub / github.com/GaijinEntertainment/daScript / arExecSql

Function arExecSql

modules/dasSQLITE/sqlite/shell.c:22417–22431  ·  view source on GitHub ↗

** Run the SQL statement in zSql. Or if doing a --dryrun, merely print it out. */

Source from the content-addressed store, hash-verified

22415** Run the SQL statement in zSql. Or if doing a --dryrun, merely print it out.
22416*/
22417static 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/*

Callers 1

arCreateOrUpdateCommandFunction · 0.85

Calls 2

utf8_printfFunction · 0.85
sqlite3_execFunction · 0.85

Tested by

no test coverage detected