also looking at this
feat(android): dbExecute and dbQuery in Zig — ratchet 84 → 82
#160
7 files
+541
-3
| @@ -2843,6 +2843,12 @@ class CraftBridge( | ||
| 2843 | 2843 | database = activity.openOrCreateDatabase("craft.db", Context.MODE_PRIVATE, null) |
| 2844 | 2844 | } |
| 2845 | 2845 | |
| 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 | ||
| 2846 | 2852 | val params = JSONArray(paramsJson) |
| 2847 | 2853 | val args = Array(params.length()) { params.getString(it) } |
| 2848 | 2854 | |
| @@ -2871,6 +2877,8 @@ class CraftBridge( | ||
| 2871 | 2877 | database = activity.openOrCreateDatabase("craft.db", Context.MODE_PRIVATE, null) |
| 2872 | 2878 | } |
| 2873 | 2879 | |
| 2880 | database?.let { if (CraftNative.dbQuery(it, sql, paramsJson)) return } | |
| 2881 | ||
| 2874 | 2882 | val params = JSONArray(paramsJson) |
| 2875 | 2883 | val args = Array(params.length()) { params.getString(it) } |
| 2876 | 2884 | |