@op-engineering/op-sqlite 2.0.4 → 2.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cpp/bridge.cpp +11 -2
- package/package.json +1 -1
package/cpp/bridge.cpp
CHANGED
|
@@ -420,14 +420,23 @@ sqliteExecute(std::string const dbName, std::string const &query,
|
|
|
420
420
|
int statementStatus =
|
|
421
421
|
sqlite3_prepare_v2(db, queryStr, -1, &statement, &remainingStatement);
|
|
422
422
|
|
|
423
|
-
if (statementStatus
|
|
423
|
+
if (statementStatus != SQLITE_OK) {
|
|
424
424
|
const char *message = sqlite3_errmsg(db);
|
|
425
425
|
return {
|
|
426
426
|
.type = SQLiteError,
|
|
427
|
-
.message = "[op-sqlite] SQL statement error:
|
|
427
|
+
.message = "[op-sqlite] SQL statement error:" +
|
|
428
|
+
std::to_string(statementStatus) +
|
|
429
|
+
" description:" + std::string(message) +
|
|
430
|
+
"see error codes: https://www.sqlite.org/rescode.html",
|
|
428
431
|
};
|
|
429
432
|
}
|
|
430
433
|
|
|
434
|
+
// The statement did not fail to parse but there is nothing to do, just skip
|
|
435
|
+
// to the end
|
|
436
|
+
if (statement == NULL) {
|
|
437
|
+
continue;
|
|
438
|
+
}
|
|
439
|
+
|
|
431
440
|
if (params != nullptr && params->size() > 0) {
|
|
432
441
|
bindStatement(statement, params);
|
|
433
442
|
}
|