@op-engineering/op-sqlite 11.4.2 → 11.4.4

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.
@@ -18,7 +18,7 @@ add_library(
18
18
  SHARED
19
19
  ../cpp/bindings.cpp
20
20
  ../cpp/utils.cpp
21
- ../cpp/ThreadPool.cpp
21
+ ../cpp/OPThreadPool.cpp
22
22
  ../cpp/SmartHostObject.cpp
23
23
  ../cpp/PreparedStatementHostObject.cpp
24
24
  ../cpp/DumbHostObject.cpp
@@ -144,6 +144,7 @@ DBHostObject::DBHostObject(jsi::Runtime &rt, std::string &url,
144
144
  std::string &auth_token,
145
145
  std::shared_ptr<react::CallInvoker> invoker)
146
146
  : db_name(url), invoker(std::move(invoker)), rt(rt) {
147
+ _thread_pool = std::make_shared<ThreadPool>();
147
148
  db = opsqlite_libsql_open_remote(url, auth_token);
148
149
 
149
150
  create_jsi_functions();
@@ -155,6 +156,7 @@ DBHostObject::DBHostObject(jsi::Runtime &rt,
155
156
  std::string &url, std::string &auth_token,
156
157
  int sync_interval)
157
158
  : db_name(db_name), invoker(std::move(invoker)), rt(rt) {
159
+ _thread_pool = std::make_shared<ThreadPool>();
158
160
  db = opsqlite_libsql_open_sync(db_name, path, url, auth_token,
159
161
  sync_interval);
160
162
 
@@ -371,7 +373,7 @@ void DBHostObject::create_jsi_functions() {
371
373
  : std::vector<JSVariant>();
372
374
 
373
375
  auto promiseCtr = rt.global().getPropertyAsFunction(rt, "Promise");
374
- auto promise = promiseCtr.callAsConstructor(rt,
376
+ auto promise = promiseCtr.callAsConstructor(rt,
375
377
  HOSTFN("executor") {
376
378
  auto task = [this, &rt, query, params,
377
379
  resolve = std::make_shared<jsi::Value>(rt, args[0]),
@@ -425,7 +427,7 @@ void DBHostObject::create_jsi_functions() {
425
427
  return {};
426
428
  }));
427
429
 
428
- return promise;
430
+ return promise;
429
431
  });
430
432
 
431
433
  function_map["executeWithHostObjects"] = HOSTFN("executeWithHostObjects") {
@@ -1,6 +1,6 @@
1
1
  #pragma once
2
2
 
3
- #include "ThreadPool.h"
3
+ #include "OPThreadPool.h"
4
4
  #include "types.h"
5
5
  #include <ReactCommon/CallInvoker.h>
6
6
  #include <jsi/jsi.h>
@@ -1,4 +1,4 @@
1
- #include "ThreadPool.h"
1
+ #include "OPThreadPool.h"
2
2
 
3
3
  namespace opsqlite {
4
4
 
@@ -9,7 +9,7 @@
9
9
  #else
10
10
  #include <sqlite3.h>
11
11
  #endif
12
- #include "ThreadPool.h"
12
+ #include "OPThreadPool.h"
13
13
  #include <string>
14
14
  #include <utility>
15
15
 
package/cpp/bindings.cpp CHANGED
@@ -1,7 +1,7 @@
1
1
  #include "bindings.h"
2
2
  #include "DBHostObject.h"
3
3
  #include "DumbHostObject.h"
4
- #include "ThreadPool.h"
4
+ #include "OPThreadPool.h"
5
5
  #ifdef OP_SQLITE_USE_LIBSQL
6
6
  #include "libsql/bridge.h"
7
7
  #else
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@op-engineering/op-sqlite",
3
- "version": "11.4.2",
3
+ "version": "11.4.4",
4
4
  "description": "Next generation SQLite for React Native",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
File without changes