@op-engineering/op-sqlite 1.0.9 → 1.0.10
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 +7 -5
- package/package.json +1 -1
package/cpp/bridge.cpp
CHANGED
|
@@ -264,6 +264,8 @@ BridgeResult sqliteExecute(std::string const dbName,
|
|
|
264
264
|
bool isConsuming = true;
|
|
265
265
|
bool isFailed = false;
|
|
266
266
|
|
|
267
|
+
int result = SQLITE_OK;
|
|
268
|
+
|
|
267
269
|
do {
|
|
268
270
|
const char *queryStr = remainingStatement == nullptr ? query.c_str() : remainingStatement;
|
|
269
271
|
|
|
@@ -274,7 +276,7 @@ BridgeResult sqliteExecute(std::string const dbName,
|
|
|
274
276
|
const char *message = sqlite3_errmsg(db);
|
|
275
277
|
return {
|
|
276
278
|
.type = SQLiteError,
|
|
277
|
-
.message = "[op-sqlite] SQL
|
|
279
|
+
.message = "[op-sqlite] SQL statement error: " + std::string(message),
|
|
278
280
|
};
|
|
279
281
|
}
|
|
280
282
|
|
|
@@ -282,7 +284,7 @@ BridgeResult sqliteExecute(std::string const dbName,
|
|
|
282
284
|
|
|
283
285
|
isConsuming = true;
|
|
284
286
|
|
|
285
|
-
int
|
|
287
|
+
int i, count, column_type;
|
|
286
288
|
std::string column_name, column_declared_type;
|
|
287
289
|
|
|
288
290
|
while (isConsuming)
|
|
@@ -390,7 +392,7 @@ BridgeResult sqliteExecute(std::string const dbName,
|
|
|
390
392
|
}
|
|
391
393
|
|
|
392
394
|
sqlite3_finalize(statement);
|
|
393
|
-
} while (strcmp(remainingStatement, "") != 0 && !isFailed);
|
|
395
|
+
} while (remainingStatement != NULL && strcmp(remainingStatement, "") != 0 && !isFailed);
|
|
394
396
|
|
|
395
397
|
|
|
396
398
|
if (isFailed)
|
|
@@ -398,7 +400,7 @@ BridgeResult sqliteExecute(std::string const dbName,
|
|
|
398
400
|
const char *message = sqlite3_errmsg(db);
|
|
399
401
|
return {
|
|
400
402
|
.type = SQLiteError,
|
|
401
|
-
.message = "[op-sqlite]
|
|
403
|
+
.message = "[op-sqlite] SQLite code: " + std::to_string(result) + " execution error: " + std::string(message)
|
|
402
404
|
};
|
|
403
405
|
}
|
|
404
406
|
|
|
@@ -434,7 +436,7 @@ BridgeResult sqliteExecuteLiteral(std::string const dbName, std::string const &q
|
|
|
434
436
|
const char *message = sqlite3_errmsg(db);
|
|
435
437
|
return {
|
|
436
438
|
SQLiteError,
|
|
437
|
-
"[op-sqlite] SQL
|
|
439
|
+
"[op-sqlite] SQL statement error: " + std::string(message),
|
|
438
440
|
0};
|
|
439
441
|
}
|
|
440
442
|
|