2021-10-28 17:49:08 +00:00
|
|
|
diff --git a/node_modules/@nozbe/watermelondb/native/android/src/main/java/com/nozbe/watermelondb/Database.kt b/node_modules/@nozbe/watermelondb/native/android/src/main/java/com/nozbe/watermelondb/Database.kt
|
|
|
|
index 802f137..cfcac91 100644
|
|
|
|
--- a/node_modules/@nozbe/watermelondb/native/android/src/main/java/com/nozbe/watermelondb/Database.kt
|
|
|
|
+++ b/node_modules/@nozbe/watermelondb/native/android/src/main/java/com/nozbe/watermelondb/Database.kt
|
|
|
|
@@ -8,7 +8,7 @@ import android.database.sqlite.SQLiteDatabase
|
|
|
|
import android.database.sqlite.SQLiteQuery
|
|
|
|
import java.io.File
|
|
|
|
|
|
|
|
-class Database(private val name: String, private val context: Context) {
|
|
|
|
+public class Database(private val name: String, private val context: Context) {
|
|
|
|
|
|
|
|
private val db: SQLiteDatabase by lazy {
|
|
|
|
SQLiteDatabase.openOrCreateDatabase(
|
|
|
|
@@ -44,7 +44,7 @@ class Database(private val name: String, private val context: Context) {
|
|
|
|
|
|
|
|
fun delete(query: SQL, args: QueryArgs) = db.execSQL(query, args)
|
|
|
|
|
|
|
|
- fun rawQuery(sql: SQL, args: QueryArgs = emptyArray()): Cursor {
|
|
|
|
+ public fun rawQuery(sql: SQL, args: QueryArgs = emptyArray()): Cursor {
|
|
|
|
// HACK: db.rawQuery only supports String args, and there's no clean way AFAIK to construct
|
|
|
|
// a query with arbitrary args (like with execSQL). However, we can misuse cursor factory
|
|
|
|
// to get the reference of a SQLiteQuery before it's executed
|
2020-09-24 18:34:13 +00:00
|
|
|
diff --git a/node_modules/@nozbe/watermelondb/native/ios/WatermelonDB/Database.swift b/node_modules/@nozbe/watermelondb/native/ios/WatermelonDB/Database.swift
|
2021-10-28 17:49:08 +00:00
|
|
|
index b4d7151..429e318 100644
|
2020-09-24 18:34:13 +00:00
|
|
|
--- a/node_modules/@nozbe/watermelondb/native/ios/WatermelonDB/Database.swift
|
|
|
|
+++ b/node_modules/@nozbe/watermelondb/native/ios/WatermelonDB/Database.swift
|
2021-10-28 17:49:08 +00:00
|
|
|
@@ -1,15 +1,15 @@
|
2020-09-24 18:34:13 +00:00
|
|
|
import Foundation
|
2021-10-28 17:49:08 +00:00
|
|
|
import SQLite3
|
2020-09-24 18:34:13 +00:00
|
|
|
|
|
|
|
-class Database {
|
|
|
|
- typealias SQL = String
|
|
|
|
- typealias TableName = String
|
|
|
|
- typealias QueryArgs = [Any]
|
|
|
|
+public class Database {
|
|
|
|
+ public typealias SQL = String
|
|
|
|
+ public typealias TableName = String
|
|
|
|
+ public typealias QueryArgs = [Any]
|
|
|
|
|
|
|
|
private let fmdb: FMDatabase
|
|
|
|
private let path: String
|
|
|
|
|
|
|
|
- init(path: String) {
|
|
|
|
+ public init(path: String) {
|
|
|
|
self.path = path
|
|
|
|
fmdb = FMDatabase(path: path)
|
|
|
|
open()
|
2021-10-28 17:49:08 +00:00
|
|
|
@@ -54,7 +54,7 @@ class Database {
|
2020-09-24 18:34:13 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
- func queryRaw(_ query: SQL, _ args: QueryArgs = []) throws -> AnyIterator<FMResultSet> {
|
|
|
|
+ public func queryRaw(_ query: SQL, _ args: QueryArgs = []) throws -> AnyIterator<FMResultSet> {
|
|
|
|
let resultSet = try fmdb.executeQuery(query, values: args)
|
|
|
|
|
|
|
|
return AnyIterator {
|