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/zig/src/jni_runtime.zigmodified+16-0
Changes to packages/zig/src/jni_runtime.zig
@@ -756,6 +756,22 @@ pub const Jni = struct {
756756 return array;
757757 }
758758
759 pub fn arrayLength(self: Self, array: jobject) JniError!usize {
760 const len: *const fn (JNIEnv, jobject) callconv(.c) jsize =
761 @ptrCast(self.table().GetArrayLength orelse return JniError.NotFound);
762 const result = len(self.env, array);
763 try self.check();
764 return @intCast(result);
765 }
766
767 pub fn objectArrayElement(self: Self, array: jobject, index: usize) JniError!jobject {
768 const get: *const fn (JNIEnv, jobject, jsize) callconv(.c) jobject =
769 @ptrCast(self.table().GetObjectArrayElement orelse return JniError.NotFound);
770 const value = get(self.env, array, @intCast(index));
771 try self.check();
772 return value;
773 }
774
759775 pub fn setObjectArrayElement(self: Self, array: jobject, index: usize, value: jobject) JniError!void {
760776 const set: *const fn (JNIEnv, jobject, jsize, jobject) callconv(.c) void =
761777 @ptrCast(self.table().SetObjectArrayElement orelse return JniError.NotFound);