From 720c0d31c82cf3225de4d228ce81234c6a1549f8 Mon Sep 17 00:00:00 2001 From: Oscar Franco Date: Sun, 1 Dec 2024 11:12:29 +0100 Subject: [PATCH] Rename create_result --- cpp/DBHostObject.cpp | 4 ++-- cpp/PreparedStatementHostObject.cpp | 2 +- cpp/utils.cpp | 6 +++--- cpp/utils.h | 7 ++++--- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/cpp/DBHostObject.cpp b/cpp/DBHostObject.cpp index 66b5b0b2..54389232 100644 --- a/cpp/DBHostObject.cpp +++ b/cpp/DBHostObject.cpp @@ -48,7 +48,7 @@ void DBHostObject::flush_pending_reactive_queries( [this, results = std::make_shared>(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); }); } @@ -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 { diff --git a/cpp/PreparedStatementHostObject.cpp b/cpp/PreparedStatementHostObject.cpp index 94ead135..38a27e4e 100644 --- a/cpp/PreparedStatementHostObject.cpp +++ b/cpp/PreparedStatementHostObject.cpp @@ -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 { diff --git a/cpp/utils.cpp b/cpp/utils.cpp index d7a41e1c..d36b25d1 100644 --- a/cpp/utils.cpp +++ b/cpp/utils.cpp @@ -155,9 +155,9 @@ jsi::Value create_js_rows(jsi::Runtime &rt, const BridgeResult &status) { } jsi::Value -createResult(jsi::Runtime &rt, BridgeResult status, - std::vector *results, - std::shared_ptr> metadata) { +create_result(jsi::Runtime &rt, BridgeResult status, + std::vector *results, + std::shared_ptr> metadata) { jsi::Object res = jsi::Object(rt); res.setProperty(rt, "rowsAffected", status.affectedRows); diff --git a/cpp/utils.h b/cpp/utils.h index 0693399d..a3494e5e 100644 --- a/cpp/utils.h +++ b/cpp/utils.h @@ -25,9 +25,10 @@ std::vector to_variant_vec(jsi::Runtime &rt, jsi::Value const &xs); std::vector to_int_vec(jsi::Runtime &rt, jsi::Value const &xs); -jsi::Value createResult(jsi::Runtime &rt, BridgeResult status, - std::vector *results, - std::shared_ptr> metadata); +jsi::Value +create_result(jsi::Runtime &rt, BridgeResult status, + std::vector *results, + std::shared_ptr> metadata); jsi::Value create_js_rows(jsi::Runtime &rt, const BridgeResult &status);