@op-engineering/op-sqlite 11.2.4 → 11.2.6
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/android/CMakeLists.txt +5 -16
- package/android/build.gradle +3 -3
- package/android/cpp-adapter.cpp +1 -1
- package/android/src/main/java/com/op/sqlite/OPSQLiteBridge.kt +1 -1
- package/android/src/main/java/com/op/sqlite/OPSQLiteModule.kt +1 -1
- package/cpp/DBHostObject.cpp +286 -374
- package/cpp/DBHostObject.h +29 -16
- package/cpp/DumbHostObject.cpp +5 -5
- package/cpp/DumbHostObject.h +8 -11
- package/cpp/PreparedStatementHostObject.cpp +54 -20
- package/cpp/PreparedStatementHostObject.h +15 -11
- package/cpp/SmartHostObject.cpp +5 -4
- package/cpp/SmartHostObject.h +4 -7
- package/cpp/ThreadPool.cpp +9 -8
- package/cpp/ThreadPool.h +4 -7
- package/cpp/bindings.cpp +14 -25
- package/cpp/bindings.h +3 -2
- package/cpp/bridge.cpp +146 -365
- package/cpp/bridge.h +30 -42
- package/cpp/libsql/bridge.cpp +65 -164
- package/cpp/libsql/bridge.h +25 -22
- package/cpp/logs.h +2 -0
- package/cpp/macros.h +8 -4
- package/cpp/sqlite3.c +5622 -2808
- package/cpp/sqlite3.h +180 -22
- package/cpp/types.h +1 -8
- package/cpp/utils.cpp +78 -67
- package/cpp/utils.h +9 -13
- package/ios/OPSQLite.mm +1 -1
- package/lib/commonjs/index.js +4 -5
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/index.js +4 -5
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/index.d.ts +1 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +16 -13
package/cpp/libsql/bridge.h
CHANGED
|
@@ -24,66 +24,69 @@ typedef std::function<void(std::string dbName, std::string table_name,
|
|
|
24
24
|
typedef std::function<void(std::string dbName)> CommitCallback;
|
|
25
25
|
typedef std::function<void(std::string dbName)> RollbackCallback;
|
|
26
26
|
|
|
27
|
+
struct DB {
|
|
28
|
+
libsql_database_t db;
|
|
29
|
+
libsql_connection_t c;
|
|
30
|
+
};
|
|
31
|
+
|
|
27
32
|
std::string opsqlite_get_db_path(std::string const &name,
|
|
28
33
|
std::string const &location);
|
|
29
34
|
|
|
30
|
-
|
|
35
|
+
DB opsqlite_libsql_open(std::string const &name,
|
|
31
36
|
std::string const &path,
|
|
32
37
|
std::string const &crsqlitePath);
|
|
33
38
|
|
|
34
|
-
|
|
39
|
+
DB opsqlite_libsql_open_remote(std::string const &url,
|
|
35
40
|
std::string const &auth_token);
|
|
36
41
|
|
|
37
|
-
|
|
42
|
+
DB opsqlite_libsql_open_sync(std::string const &name,
|
|
38
43
|
std::string const &path,
|
|
39
44
|
std::string const &url,
|
|
40
45
|
std::string const &auth_token,
|
|
41
46
|
int sync_interval);
|
|
42
47
|
|
|
43
|
-
|
|
48
|
+
void opsqlite_libsql_close(DB &db);
|
|
44
49
|
|
|
45
|
-
|
|
50
|
+
void opsqlite_libsql_remove(DB &db, std::string const &name,
|
|
46
51
|
std::string const &path);
|
|
47
52
|
|
|
48
|
-
|
|
53
|
+
void opsqlite_libsql_attach(DB const &db,
|
|
49
54
|
std::string const &docPath,
|
|
50
55
|
std::string const &databaseToAttach,
|
|
51
56
|
std::string const &alias);
|
|
52
57
|
|
|
53
|
-
|
|
58
|
+
void opsqlite_libsql_detach(DB const &db,
|
|
54
59
|
std::string const &alias);
|
|
55
60
|
|
|
56
|
-
|
|
61
|
+
void opsqlite_libsql_sync(DB const &db);
|
|
57
62
|
|
|
58
|
-
BridgeResult opsqlite_libsql_execute(
|
|
59
|
-
|
|
60
|
-
|
|
63
|
+
BridgeResult opsqlite_libsql_execute(DB const &db,
|
|
64
|
+
std::string const &query,
|
|
65
|
+
const std::vector<JSVariant> *params);
|
|
61
66
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
67
|
+
BridgeResult opsqlite_libsql_execute_with_host_objects(
|
|
68
|
+
DB const &db, std::string const &query,
|
|
69
|
+
const std::vector<JSVariant> *params, std::vector<DumbHostObject> *results,
|
|
70
|
+
const std::shared_ptr<std::vector<SmartHostObject>> &metadatas);
|
|
66
71
|
|
|
67
72
|
BridgeResult
|
|
68
|
-
opsqlite_libsql_execute_raw(
|
|
73
|
+
opsqlite_libsql_execute_raw(DB const &db, std::string const &query,
|
|
69
74
|
const std::vector<JSVariant> *params,
|
|
70
75
|
std::vector<std::vector<JSVariant>> *results);
|
|
71
76
|
|
|
72
77
|
BatchResult
|
|
73
|
-
opsqlite_libsql_execute_batch(
|
|
78
|
+
opsqlite_libsql_execute_batch(DB const &db,
|
|
74
79
|
std::vector<BatchArguments> *commands);
|
|
75
80
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
libsql_stmt_t opsqlite_libsql_prepare_statement(std::string const &name,
|
|
81
|
+
libsql_stmt_t opsqlite_libsql_prepare_statement(DB const &db,
|
|
79
82
|
std::string const &query);
|
|
80
83
|
|
|
81
84
|
void opsqlite_libsql_bind_statement(libsql_stmt_t stmt,
|
|
82
85
|
const std::vector<JSVariant> *params);
|
|
83
86
|
|
|
84
87
|
BridgeResult opsqlite_libsql_execute_prepared_statement(
|
|
85
|
-
|
|
88
|
+
DB const &db, libsql_stmt_t stmt,
|
|
86
89
|
std::vector<DumbHostObject> *results,
|
|
87
|
-
const std::shared_ptr<std::vector<SmartHostObject
|
|
90
|
+
const std::shared_ptr<std::vector<SmartHostObject>> &metadatas);
|
|
88
91
|
|
|
89
92
|
} // namespace opsqlite
|
package/cpp/logs.h
CHANGED
package/cpp/macros.h
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
#
|
|
2
|
-
#define macros_h
|
|
1
|
+
#pragma once
|
|
3
2
|
|
|
4
3
|
#define HOSTFN(name) \
|
|
5
4
|
jsi::Function::createFromHostFunction( \
|
|
6
5
|
rt, \
|
|
7
6
|
jsi::PropNameID::forAscii(rt, name), \
|
|
8
7
|
0, \
|
|
9
|
-
[
|
|
8
|
+
[=, this](jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count) -> jsi::Value
|
|
10
9
|
|
|
11
|
-
#
|
|
10
|
+
#define HOST_STATIC_FN(name) \
|
|
11
|
+
jsi::Function::createFromHostFunction( \
|
|
12
|
+
rt, \
|
|
13
|
+
jsi::PropNameID::forAscii(rt, name), \
|
|
14
|
+
0, \
|
|
15
|
+
[=](jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count) -> jsi::Value
|