@op-engineering/op-sqlite 0.0.0-resolution-test
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/LICENSE +7 -0
- package/README.md +31 -0
- package/android/.project +17 -0
- package/android/.settings/org.eclipse.buildship.core.prefs +13 -0
- package/android/CMakeLists.txt +141 -0
- package/android/build.gradle +266 -0
- package/android/c_sources/tokenizers.cpp +88 -0
- package/android/c_sources/tokenizers.h +15 -0
- package/android/cpp-adapter.cpp +46 -0
- package/android/gradle.properties +1 -0
- package/android/jniLibs/arm64-v8a/libsql_experimental.a +0 -0
- package/android/jniLibs/armeabi-v7a/libsql_experimental.a +0 -0
- package/android/jniLibs/x86/libsql_experimental.a +0 -0
- package/android/jniLibs/x86_64/libsql_experimental.a +0 -0
- package/android/src/main/AndroidManifest.xml +1 -0
- package/android/src/main/java/com/op/sqlite/OPSQLiteBridge.kt +37 -0
- package/android/src/main/java/com/op/sqlite/OPSQLiteModule.kt +119 -0
- package/android/src/main/java/com/op/sqlite/OPSQLitePackage.kt +18 -0
- package/android/src/main/jniLibs/arm64-v8a/libcrsqlite.so +0 -0
- package/android/src/main/jniLibs/arm64-v8a/libsqlite_vec.so +0 -0
- package/android/src/main/jniLibs/armeabi-v7a/libcrsqlite.so +0 -0
- package/android/src/main/jniLibs/armeabi-v7a/libsqlite_vec.so +0 -0
- package/android/src/main/jniLibs/x86/libcrsqlite.so +0 -0
- package/android/src/main/jniLibs/x86/libsqlite_vec.so +0 -0
- package/android/src/main/jniLibs/x86_64/libcrsqlite.so +0 -0
- package/android/src/main/jniLibs/x86_64/libsqlite_vec.so +0 -0
- package/android/src/paper/java/com/op/sqlite/NativeOPSQLiteSpec.java +77 -0
- package/cpp/DBHostObject.cpp +852 -0
- package/cpp/DBHostObject.h +99 -0
- package/cpp/DumbHostObject.cpp +72 -0
- package/cpp/DumbHostObject.h +36 -0
- package/cpp/OPThreadPool.cpp +120 -0
- package/cpp/OPThreadPool.h +44 -0
- package/cpp/PreparedStatementHostObject.cpp +151 -0
- package/cpp/PreparedStatementHostObject.h +59 -0
- package/cpp/SmartHostObject.cpp +34 -0
- package/cpp/SmartHostObject.h +24 -0
- package/cpp/bindings.cpp +182 -0
- package/cpp/bindings.h +19 -0
- package/cpp/bridge.cpp +873 -0
- package/cpp/bridge.h +80 -0
- package/cpp/libsql/bridge.cpp +738 -0
- package/cpp/libsql/bridge.h +85 -0
- package/cpp/libsql/libsql.h +172 -0
- package/cpp/logs.h +40 -0
- package/cpp/macros.h +15 -0
- package/cpp/sqlcipher/sqlite3.c +262970 -0
- package/cpp/sqlcipher/sqlite3.h +13485 -0
- package/cpp/sqlite3.c +261454 -0
- package/cpp/sqlite3.h +13715 -0
- package/cpp/types.h +33 -0
- package/cpp/utils.cpp +327 -0
- package/cpp/utils.h +47 -0
- package/generate_tokenizers_header_file.rb +29 -0
- package/ios/OPSQLite.h +7 -0
- package/ios/OPSQLite.mm +157 -0
- package/ios/OPSQLite.xcodeproj/project.pbxproj +275 -0
- package/ios/crsqlite.xcframework/Info.plist +46 -0
- package/ios/crsqlite.xcframework/ios-arm64/crsqlite.framework/Info.plist +24 -0
- package/ios/crsqlite.xcframework/ios-arm64/crsqlite.framework/crsqlite +0 -0
- package/ios/crsqlite.xcframework/ios-arm64_x86_64-simulator/crsqlite.framework/Info.plist +24 -0
- package/ios/crsqlite.xcframework/ios-arm64_x86_64-simulator/crsqlite.framework/crsqlite +0 -0
- package/ios/libsql.xcframework/Info.plist +48 -0
- package/ios/libsql.xcframework/ios-arm64/Headers/libsql.h +172 -0
- package/ios/libsql.xcframework/ios-arm64/libsql_experimental.a +0 -0
- package/ios/libsql.xcframework/ios-arm64_x86_64-simulator/Headers/libsql.h +172 -0
- package/ios/libsql.xcframework/ios-arm64_x86_64-simulator/libsql_experimental.a +0 -0
- package/ios/sqlitevec.xcframework/Info.plist +71 -0
- package/ios/sqlitevec.xcframework/ios-arm64/sqlitevec.framework/Info.plist +24 -0
- package/ios/sqlitevec.xcframework/ios-arm64/sqlitevec.framework/sqlitevec +0 -0
- package/ios/sqlitevec.xcframework/ios-arm64_x86_64-simulator/sqlitevec.framework/Info.plist +24 -0
- package/ios/sqlitevec.xcframework/ios-arm64_x86_64-simulator/sqlitevec.framework/sqlitevec +0 -0
- package/ios/sqlitevec.xcframework/tvos-arm64/sqlitevec.framework/Info.plist +24 -0
- package/ios/sqlitevec.xcframework/tvos-arm64/sqlitevec.framework/sqlitevec +0 -0
- package/ios/sqlitevec.xcframework/tvos-arm64_x86_64-simulator/sqlitevec.framework/Info.plist +24 -0
- package/ios/sqlitevec.xcframework/tvos-arm64_x86_64-simulator/sqlitevec.framework/sqlitevec +0 -0
- package/lib/commonjs/NativeOPSQLite.js +9 -0
- package/lib/commonjs/NativeOPSQLite.js.map +1 -0
- package/lib/commonjs/Storage.js +60 -0
- package/lib/commonjs/Storage.js.map +1 -0
- package/lib/commonjs/index.js +365 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/module/NativeOPSQLite.js +3 -0
- package/lib/module/NativeOPSQLite.js.map +1 -0
- package/lib/module/Storage.js +53 -0
- package/lib/module/Storage.js.map +1 -0
- package/lib/module/index.js +340 -0
- package/lib/module/index.js.map +1 -0
- package/lib/typescript/src/NativeOPSQLite.d.ts +15 -0
- package/lib/typescript/src/NativeOPSQLite.d.ts.map +1 -0
- package/lib/typescript/src/Storage.d.ts +23 -0
- package/lib/typescript/src/Storage.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +319 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/op-sqlite.podspec +212 -0
- package/package.json +85 -0
- package/src/NativeOPSQLite.ts +17 -0
- package/src/Storage.ts +85 -0
- package/src/index.ts +722 -0
package/cpp/bridge.h
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#include "DumbHostObject.h"
|
|
4
|
+
#include "SmartHostObject.h"
|
|
5
|
+
#include "types.h"
|
|
6
|
+
#include "utils.h"
|
|
7
|
+
#include <sqlite3.h>
|
|
8
|
+
#include <vector>
|
|
9
|
+
|
|
10
|
+
namespace opsqlite {
|
|
11
|
+
|
|
12
|
+
namespace jsi = facebook::jsi;
|
|
13
|
+
|
|
14
|
+
/// Convenience types to avoid super long types
|
|
15
|
+
typedef std::function<void(std::string dbName, std::string tableName,
|
|
16
|
+
std::string operation, int rowId)>
|
|
17
|
+
UpdateCallback;
|
|
18
|
+
typedef std::function<void(std::string dbName)> CommitCallback;
|
|
19
|
+
typedef std::function<void(std::string dbName)> RollbackCallback;
|
|
20
|
+
|
|
21
|
+
std::string opsqlite_get_db_path(std::string const &db_name,
|
|
22
|
+
std::string const &location);
|
|
23
|
+
|
|
24
|
+
#ifdef OP_SQLITE_USE_SQLCIPHER
|
|
25
|
+
sqlite3 *opsqlite_open(std::string const &dbName, std::string const &path,
|
|
26
|
+
std::string const &crsqlite_path,
|
|
27
|
+
std::string const &sqlite_vec_path,
|
|
28
|
+
std::string const &encryption_key);
|
|
29
|
+
#else
|
|
30
|
+
sqlite3 *opsqlite_open(std::string const &name, std::string const &path,
|
|
31
|
+
[[maybe_unused]] std::string const &crsqlite_path,
|
|
32
|
+
std::string const &sqlite_vec_path);
|
|
33
|
+
#endif
|
|
34
|
+
|
|
35
|
+
void opsqlite_close(sqlite3 *db);
|
|
36
|
+
|
|
37
|
+
void opsqlite_remove(sqlite3 *db, std::string const &name,
|
|
38
|
+
std::string const &doc_path);
|
|
39
|
+
|
|
40
|
+
void opsqlite_attach(sqlite3 *db, std::string const &doc_path,
|
|
41
|
+
std::string const &secondary_db_name,
|
|
42
|
+
std::string const &alias);
|
|
43
|
+
|
|
44
|
+
void opsqlite_detach(sqlite3 *db, std::string const &alias);
|
|
45
|
+
|
|
46
|
+
BridgeResult opsqlite_execute(sqlite3 *db, std::string const &query,
|
|
47
|
+
const std::vector<JSVariant> *params);
|
|
48
|
+
|
|
49
|
+
BridgeResult opsqlite_execute_host_objects(
|
|
50
|
+
sqlite3 *db, std::string const &query, const std::vector<JSVariant> *params,
|
|
51
|
+
std::vector<DumbHostObject> *results,
|
|
52
|
+
std::shared_ptr<std::vector<SmartHostObject>> &metadatas);
|
|
53
|
+
|
|
54
|
+
BatchResult opsqlite_execute_batch(sqlite3 *db,
|
|
55
|
+
const std::vector<BatchArguments> *commands);
|
|
56
|
+
|
|
57
|
+
BridgeResult opsqlite_execute_raw(sqlite3 *db, std::string const &query,
|
|
58
|
+
const std::vector<JSVariant> *params,
|
|
59
|
+
std::vector<std::vector<JSVariant>> *results);
|
|
60
|
+
|
|
61
|
+
void opsqlite_register_update_hook(sqlite3 *db, void *db_host_object_ptr);
|
|
62
|
+
void opsqlite_deregister_update_hook(sqlite3 *db);
|
|
63
|
+
void opsqlite_register_commit_hook(sqlite3 *db, void *db_host_object_ptr);
|
|
64
|
+
void opsqlite_deregister_commit_hook(sqlite3 *db);
|
|
65
|
+
void opsqlite_register_rollback_hook(sqlite3 *db, void *db_host_object_ptr);
|
|
66
|
+
void opsqlite_deregister_rollback_hook(sqlite3 *db);
|
|
67
|
+
|
|
68
|
+
sqlite3_stmt *opsqlite_prepare_statement(sqlite3 *db, std::string const &query);
|
|
69
|
+
|
|
70
|
+
void opsqlite_bind_statement(sqlite3_stmt *statement,
|
|
71
|
+
const std::vector<JSVariant> *params);
|
|
72
|
+
|
|
73
|
+
BridgeResult opsqlite_execute_prepared_statement(
|
|
74
|
+
sqlite3 *db, sqlite3_stmt *statement, std::vector<DumbHostObject> *results,
|
|
75
|
+
std::shared_ptr<std::vector<SmartHostObject>> &metadatas);
|
|
76
|
+
|
|
77
|
+
void opsqlite_load_extension(sqlite3 *db, std::string &path,
|
|
78
|
+
std::string &entry_point);
|
|
79
|
+
|
|
80
|
+
} // namespace opsqlite
|