Skip to content

Commit

Permalink
Merge pull request #195 from OP-Engineering/oscar/dedupe-to-variant-f…
Browse files Browse the repository at this point in the history
…unction

De-dupe to variant function and correctly throw when object is passed
  • Loading branch information
ospfranco authored Dec 1, 2024
2 parents 00489fe + d204539 commit 28f9c41
Show file tree
Hide file tree
Showing 8 changed files with 259 additions and 296 deletions.
4 changes: 2 additions & 2 deletions cpp/DBHostObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ void DBHostObject::flush_pending_reactive_queries(
[this,
results = std::make_shared<std::vector<DumbHostObject>>(results),
callback = query->callback, metadata, status = std::move(status)] {
auto jsiResult = createResult(rt, status, results.get(), metadata);
auto jsiResult = create_result(rt, status, results.get(), metadata);
callback->asObject(rt).asFunction(rt).call(rt, jsiResult);
});
}
Expand Down Expand Up @@ -486,7 +486,7 @@ void DBHostObject::create_jsi_functions() {
metadata, status = std::move(status), resolve, reject] {
if (status.type == SQLiteOk) {
auto jsiResult =
createResult(rt, status, results.get(), metadata);
create_result(rt, status, results.get(), metadata);
resolve->asObject(rt).asFunction(rt).call(
rt, std::move(jsiResult));
} else {
Expand Down
2 changes: 1 addition & 1 deletion cpp/PreparedStatementHostObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jsi::Value PreparedStatementHostObject::get(jsi::Runtime &rt,
metadata, resolve, reject] {
if (status.type == SQLiteOk) {
auto jsiResult =
createResult(rt, status, results.get(), metadata);
create_result(rt, status, results.get(), metadata);
resolve->asObject(rt).asFunction(rt).call(
rt, std::move(jsiResult));
} else {
Expand Down
Loading

0 comments on commit 28f9c41

Please sign in to comment.