@op-engineering/op-sqlite 9.2.6 → 9.3.0

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/README.md CHANGED
@@ -6,12 +6,17 @@ OP-SQLite has grown large to cover a lot of plugins, sqlite versions and APIs. P
6
6
 
7
7
  [See the docs](https://ospfranco.notion.site/OP-SQLite-Documentation-a279a52102464d0cb13c3fa230d2f2dc?pvs=4)
8
8
 
9
+ Join the Discord:
10
+
11
+ https://discord.gg/W9XmqCQCKP
12
+
9
13
  Some of the big and external (back-ends, out-of-tree features, plugins) supported features:
10
14
 
11
15
  - Vanilla sqlite ofc
12
16
  - Libsql is supported as a sqlite backend
13
17
  - SQLCipher is supported as a sqlite backend
14
18
  - FTS5 plugin
19
+ - Rtree plugin
15
20
  - cr-sqlite plugin
16
21
  - sqlite-vec plugin
17
22
  - Reactive queries (currently with some issues, please donate)
@@ -34,6 +34,7 @@ def performanceMode = "0"
34
34
  def sqliteFlags = ""
35
35
  def enableFTS5 = false
36
36
  def useSqliteVec = false
37
+ def enableRtree = false
37
38
 
38
39
  def packageJsonFile = new File("$rootDir/../package.json")
39
40
  def packageJson = new JsonSlurper().parseText(packageJsonFile.text)
@@ -47,6 +48,7 @@ if(opsqliteConfig) {
47
48
  sqliteFlags = opsqliteConfig["sqliteFlags"] ? opsqliteConfig["sqliteFlags"] : ""
48
49
  enableFTS5 = opsqliteConfig["fts5"]
49
50
  useLibsql = opsqliteConfig["libsql"]
51
+ enableRtree = opsqliteConfig["rtree"]
50
52
  }
51
53
 
52
54
  if(useSQLCipher) {
@@ -73,6 +75,10 @@ if(enableFTS5) {
73
75
  println "[OP-SQLITE] FTS5 enabled! 🔎"
74
76
  }
75
77
 
78
+ if(enableRtree) {
79
+ println "[OP-SQLITE] RTree enabled! 🌲"
80
+ }
81
+
76
82
  if(useSqliteVec) {
77
83
  println "[OP-SQLITE] Sqlite Vec enabled! ↗️"
78
84
  }
@@ -137,7 +143,10 @@ android {
137
143
  cFlags += ["-DSQLITE_DQS=0", "-DSQLITE_THREADSAFE=1", "-DSQLITE_DEFAULT_MEMSTATUS=0", "-DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1", "-DSQLITE_LIKE_DOESNT_MATCH_BLOBS=1", "-DSQLITE_MAX_EXPR_DEPTH=0", "-DSQLITE_OMIT_DEPRECATED=1", "-DSQLITE_OMIT_PROGRESS_CALLBACK=1", "-DSQLITE_OMIT_SHARED_CACHE=1", "-DSQLITE_USE_ALLOCA=1"]
138
144
  }
139
145
  if(enableFTS5) {
140
- cFlags += ["-DSQLITE_ENABLE_FTS4=1", "-DSQLITE_ENABLE_FTS3_PARENTHESIS=1", "-DSQLITE_ENABLE_FTS5=1"]
146
+ cFlags += ["-DSQLITE_ENABLE_FTS5=1"]
147
+ }
148
+ if(enableRtree) {
149
+ cFlags += ["-DSQLITE_ENABLE_RTREE=1"]
141
150
  }
142
151
  if(useSqliteVec) {
143
152
  cFlags += "-DOP_SQLITE_USE_SQLITE_VEC=1"
@@ -52,6 +52,8 @@ void DBHostObject::flush_pending_reactive_queries(std::shared_ptr<jsi::Value> re
52
52
  }
53
53
  }
54
54
 
55
+ pending_reactive_queries.clear();
56
+
55
57
  invoker->invokeAsync(
56
58
  [this, resolve]() { resolve->asObject(rt).asFunction(rt).call(rt, {}); });
57
59
  }
package/op-sqlite.podspec CHANGED
@@ -10,10 +10,10 @@ fabric_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1'
10
10
 
11
11
  parent_folder_name = File.basename(__dir__)
12
12
  app_package = nil
13
- # for development purposes on user machines the podspec should be able to read the package.json from the root folder
14
- # since it lives inside node_modules/@op-engineering/op-sqlite
13
+ # When installed on user node_modules lives inside node_modules/@op-engineering/op-sqlite
15
14
  if __dir__.include?("node_modules")
16
15
  app_package = JSON.parse(File.read(File.join(__dir__, "..", "..", "..", "package.json")))
16
+ # When running on the example app
17
17
  else
18
18
  app_package = JSON.parse(File.read(File.join(__dir__, "example", "package.json")))
19
19
  end
@@ -26,6 +26,7 @@ performance_mode = "0"
26
26
  phone_version = false
27
27
  sqlite_flags = ""
28
28
  fts5 = false
29
+ rtree = false
29
30
  use_sqlite_vec = false
30
31
 
31
32
  if(op_sqlite_config != nil)
@@ -36,13 +37,31 @@ if(op_sqlite_config != nil)
36
37
  phone_version = op_sqlite_config["iosSqlite"] == true
37
38
  sqlite_flags = op_sqlite_config["sqliteFlags"] || ""
38
39
  fts5 = op_sqlite_config["fts5"] == true
40
+ rtree = op_sqlite_config["rtree"] == true
39
41
  use_sqlite_vec = op_sqlite_config["sqliteVec"] == true
40
42
  end
41
43
 
42
- if phone_version && use_sqlcipher
43
- raise "Cannot use phone embedded version and SQLCipher. SQLCipher needs to be compiled from sources with the project."
44
- end
44
+ if phone_version then
45
+ if use_sqlcipher then
46
+ raise "SQLCipher is not supported with phone version"
47
+ end
48
+
49
+ if use_crsqlite then
50
+ raise "CRSQLite is not supported with phone version"
51
+ end
45
52
 
53
+ if fts5 then
54
+ raise "FTS5 is not supported with phone version"
55
+ end
56
+
57
+ if rtree then
58
+ raise "RTree is not supported with phone version"
59
+ end
60
+
61
+ if use_sqlite_vec then
62
+ raise "SQLite Vec is not supported with phone version"
63
+ end
64
+ end
46
65
 
47
66
  Pod::Spec.new do |s|
48
67
  s.name = "op-sqlite"
@@ -91,24 +110,17 @@ Pod::Spec.new do |s|
91
110
  optimizedCflags = other_cflags + '$(inherited) -DSQLITE_DQS=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS=1 -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_OMIT_DEPRECATED=1 -DSQLITE_OMIT_PROGRESS_CALLBACK=1 -DSQLITE_OMIT_SHARED_CACHE=1 -DSQLITE_USE_ALLOCA=1'
92
111
  frameworks = []
93
112
 
94
- if fts5 && !phone_version then
113
+ if fts5 then
95
114
  log_message.call("[OP-SQLITE] FTS5 enabled 🔎")
96
115
  xcconfig[:GCC_PREPROCESSOR_DEFINITIONS] += " SQLITE_ENABLE_FTS5=1"
97
116
  end
117
+
118
+ if rtree then
119
+ log_message.call("[OP-SQLITE] RTree enabled 🌲")
120
+ xcconfig[:GCC_PREPROCESSOR_DEFINITIONS] += " SQLITE_ENABLE_RTREE=1"
121
+ end
98
122
 
99
123
  if phone_version then
100
- if use_sqlcipher then
101
- raise "SQLCipher is not supported with phone version"
102
- end
103
-
104
- if use_crsqlite then
105
- raise "CRSQLite is not supported with phone version"
106
- end
107
-
108
- if fts5 then
109
- raise "FTS5 is not supported with phone version"
110
- end
111
-
112
124
  log_message.call("[OP-SQLITE] using iOS embedded SQLite 📱")
113
125
  xcconfig[:GCC_PREPROCESSOR_DEFINITIONS] += " OP_SQLITE_USE_PHONE_VERSION=1"
114
126
  s.exclude_files = "cpp/sqlite3.c", "cpp/sqlite3.h"
@@ -138,9 +150,6 @@ Pod::Spec.new do |s|
138
150
  end
139
151
 
140
152
  if use_libsql then
141
- if use_sqlcipher then
142
- raise "Cannot use SQLCipher and libsql at the same time"
143
- end
144
153
  xcconfig[:GCC_PREPROCESSOR_DEFINITIONS] += " OP_SQLITE_USE_LIBSQL=1"
145
154
  if use_crsqlite then
146
155
  frameworks = ["ios/libsql.xcframework", "ios/crsqlite.xcframework"]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@op-engineering/op-sqlite",
3
- "version": "9.2.6",
3
+ "version": "9.3.0",
4
4
  "description": "Next generation SQLite for React Native",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",