@op-engineering/op-sqlite 9.1.0 → 9.1.1
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/README.md +1 -1
- package/cpp/DBHostObject.cpp +1 -1
- package/cpp/bridge.cpp +5 -6
- package/package.json +1 -1
package/README.md
CHANGED
package/cpp/DBHostObject.cpp
CHANGED
|
@@ -379,7 +379,7 @@ void DBHostObject::create_jsi_functions() {
|
|
|
379
379
|
auto resolve = std::make_shared<jsi::Value>(rt, args[0]);
|
|
380
380
|
auto reject = std::make_shared<jsi::Value>(rt, args[1]);
|
|
381
381
|
|
|
382
|
-
auto task = [&rt, this, query, params = std::move(params), resolve,
|
|
382
|
+
auto task = [&rt, this, query = std::move(query), params = std::move(params), resolve,
|
|
383
383
|
reject, invoker = this->jsCallInvoker]() {
|
|
384
384
|
try {
|
|
385
385
|
|
package/cpp/bridge.cpp
CHANGED
|
@@ -315,7 +315,7 @@ BridgeResult opsqlite_execute_prepared_statement(
|
|
|
315
315
|
}
|
|
316
316
|
|
|
317
317
|
if (results != nullptr) {
|
|
318
|
-
results->
|
|
318
|
+
results->emplace_back(row);
|
|
319
319
|
}
|
|
320
320
|
|
|
321
321
|
break;
|
|
@@ -335,7 +335,7 @@ BridgeResult opsqlite_execute_prepared_statement(
|
|
|
335
335
|
metadata.fields.emplace_back("type",
|
|
336
336
|
type == nullptr ? "UNKNOWN" : type);
|
|
337
337
|
|
|
338
|
-
metadatas->
|
|
338
|
+
metadatas->emplace_back(metadata);
|
|
339
339
|
i++;
|
|
340
340
|
}
|
|
341
341
|
}
|
|
@@ -400,11 +400,9 @@ BridgeResult opsqlite_execute(std::string const &name, std::string const &query,
|
|
|
400
400
|
int status, current_column, column_count, column_type;
|
|
401
401
|
std::string column_name, column_declared_type;
|
|
402
402
|
std::vector<std::string> column_names;
|
|
403
|
-
column_names.reserve(20);
|
|
404
403
|
std::vector<std::vector<JSVariant>> rows;
|
|
405
404
|
rows.reserve(20);
|
|
406
405
|
std::vector<JSVariant> row;
|
|
407
|
-
row.reserve(10);
|
|
408
406
|
|
|
409
407
|
do {
|
|
410
408
|
const char *query_str =
|
|
@@ -432,6 +430,7 @@ BridgeResult opsqlite_execute(std::string const &name, std::string const &query,
|
|
|
432
430
|
}
|
|
433
431
|
|
|
434
432
|
column_count = sqlite3_column_count(statement);
|
|
433
|
+
column_names.reserve(column_count);
|
|
435
434
|
bool is_consuming_rows = true;
|
|
436
435
|
double double_value;
|
|
437
436
|
const char *string_value;
|
|
@@ -449,7 +448,7 @@ BridgeResult opsqlite_execute(std::string const &name, std::string const &query,
|
|
|
449
448
|
case SQLITE_ROW:
|
|
450
449
|
current_column = 0;
|
|
451
450
|
row = std::vector<JSVariant>();
|
|
452
|
-
column_count
|
|
451
|
+
row.reserve(column_count);
|
|
453
452
|
|
|
454
453
|
while (current_column < column_count) {
|
|
455
454
|
column_type = sqlite3_column_type(statement, current_column);
|
|
@@ -494,7 +493,7 @@ BridgeResult opsqlite_execute(std::string const &name, std::string const &query,
|
|
|
494
493
|
current_column++;
|
|
495
494
|
}
|
|
496
495
|
|
|
497
|
-
rows.
|
|
496
|
+
rows.emplace_back(std::move(row));
|
|
498
497
|
break;
|
|
499
498
|
|
|
500
499
|
case SQLITE_DONE:
|