diff --git a/cpp/PreparedStatementHostObject.cpp b/cpp/PreparedStatementHostObject.cpp index bcbf6e1..f2f9dae 100644 --- a/cpp/PreparedStatementHostObject.cpp +++ b/cpp/PreparedStatementHostObject.cpp @@ -56,13 +56,14 @@ jsi::Value PreparedStatementHostObject::get(jsi::Runtime &rt, std::vector results; std::shared_ptr> metadata = std::make_shared>(); + try { #ifdef OP_SQLITE_USE_LIBSQL - auto status = opsqlite_libsql_execute_prepared_statement( - _name, _stmt, &results, metadata); + auto status = opsqlite_libsql_execute_prepared_statement( + _name, _stmt, &results, metadata); #else - try { auto status = opsqlite_execute_prepared_statement( _db, _stmt, &results, metadata); +#endif invoker->invokeAsync( [&rt, status = std::move(status), results = @@ -81,7 +82,6 @@ jsi::Value PreparedStatementHostObject::get(jsi::Runtime &rt, reject->asObject(rt).asFunction(rt).call(rt, error); }); } -#endif }; _thread_pool->queueWork(task); diff --git a/cpp/PreparedStatementHostObject.h b/cpp/PreparedStatementHostObject.h index 24ea0af..bf5fb9a 100644 --- a/cpp/PreparedStatementHostObject.h +++ b/cpp/PreparedStatementHostObject.h @@ -23,15 +23,14 @@ class PreparedStatementHostObject : public jsi::HostObject { std::shared_ptr js_call_invoker, std::shared_ptr thread_pool) : _name(name), _stmt(stmt), _js_call_invoker(js_call_invoker), - _thread_pool(thread_pool){}; + _thread_pool(thread_pool) {}; #else PreparedStatementHostObject( - sqlite3 *db, - std::string name, sqlite3_stmt *stmt, + sqlite3 *db, std::string name, sqlite3_stmt *stmt, std::shared_ptr js_call_invoker, std::shared_ptr thread_pool) : _db(db), _name(name), _stmt(stmt), _js_call_invoker(js_call_invoker), - _thread_pool(thread_pool){}; + _thread_pool(thread_pool) {}; #endif virtual ~PreparedStatementHostObject();