@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.
Files changed (2) hide show
  1. package/cpp/bridge.cpp +11 -2
  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 == SQLITE_ERROR) {
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: " + std::string(message),
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@op-engineering/op-sqlite",
3
- "version": "2.0.4",
3
+ "version": "2.0.5",
4
4
  "description": "Next generation SQLite for React Native",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",