ReviewOS

also looking at this

craft-native/craft

feat(android): dbExecute and dbQuery in Zig — ratchet 84 → 82

#160
Merged glennmichael123 wants to merge feat/android-sqlite into main
7 files +541 -3
packages/android/templates/CraftBridge.kt.templatemodified+8-0
Changes to packages/android/templates/CraftBridge.kt.template
@@ -2843,6 +2843,12 @@ class CraftBridge(
28432843 database = activity.openOrCreateDatabase("craft.db", Context.MODE_PRIVATE, null)
28442844 }
28452845
2846 // After the open, so Zig borrows this connection rather than
2847 // starting a second one against the same file. Zig answers through
2848 // the reply channel, so returning is what stops the promise being
2849 // settled twice.
2850 database?.let { if (CraftNative.dbExecute(it, sql, paramsJson)) return }
2851
28462852 val params = JSONArray(paramsJson)
28472853 val args = Array(params.length()) { params.getString(it) }
28482854
@@ -2871,6 +2877,8 @@ class CraftBridge(
28712877 database = activity.openOrCreateDatabase("craft.db", Context.MODE_PRIVATE, null)
28722878 }
28732879
2880 database?.let { if (CraftNative.dbQuery(it, sql, paramsJson)) return }
2881
28742882 val params = JSONArray(paramsJson)
28752883 val args = Array(params.length()) { params.getString(it) }
28762884