diff --git a/DBModule/Sources/DBModule/Database.swift b/DBModule/Sources/DBModule/Database.swift index 67225b05c..54c69058a 100644 --- a/DBModule/Sources/DBModule/Database.swift +++ b/DBModule/Sources/DBModule/Database.swift @@ -17,6 +17,7 @@ public struct DatabaseFactory { userInfo: [NSLocalizedDescriptionKey: "Database path cannot be blank"]) } let connection = try! Connection(databasePath) + connection.trace { print($0) } return DatabaseManager(database: connection) } } diff --git a/DBModule/Sources/DBModule/ValueUtil.swift b/DBModule/Sources/DBModule/ValueUtil.swift index 830db1b77..baa377170 100644 --- a/DBModule/Sources/DBModule/ValueUtil.swift +++ b/DBModule/Sources/DBModule/ValueUtil.swift @@ -68,7 +68,14 @@ public class ValueUtil { case TYPE_BYTES: if let bytes = arg.bytes() { let byteArray = [UInt8](bytes) - bindings.append(Blob(bytes: byteArray)) + let str = String(bytes: byteArray, encoding: .utf8)! + if str == "T/messages/%" && false { + print("Appending as string \(str)") + bindings.append("%") + } else { + print("Appending as bytes \(str)") + bindings.append(Blob(bytes: byteArray)) + } } else { bindings.append(nil) } diff --git a/DBModule/Tests/DBModuleTests/DBModuleTests.swift b/DBModule/Tests/DBModuleTests/DBModuleTests.swift index d0c97c000..718c459c1 100644 --- a/DBModule/Tests/DBModuleTests/DBModuleTests.swift +++ b/DBModule/Tests/DBModuleTests/DBModuleTests.swift @@ -17,16 +17,46 @@ final class DBModuleTests: XCTestCase, TestsupportTestingTProtocol { continueAfterFailure = false } -// func testList() throws { -// let db = try newDB() -// TestsupportTestList(self, db) -// } - func testTransactions() throws { let db = try newDB() TestsupportTestTransactions(self, db) } + func testSubscriptions() throws { + let db = try newDB() + TestsupportTestSubscriptions(self, db) + } + + func testSubscribeToInitialDetails() throws { + let db = try newDB() + TestsupportTestSubscribeToInitialDetails(self, db) + } + + func testDetailSubscriptionModifyDetails() throws { + let db = try newDB() + TestsupportTestDetailSubscriptionModifyDetails(self, db) + } + + func testDetailSubscriptionModifyIndex() throws { + let db = try newDB() + TestsupportTestDetailSubscriptionModifyIndex(self, db) + } + + func testList() throws { + let db = try newDB() + TestsupportTestList(self, db) + } + + func testSearch() throws { + let db = try newDB() + TestsupportTestSearch(self, db) + } + + func testSearchChinese() throws { + let db = try newDB() + TestsupportTestSearchChinese(self, db) + } + private func newDB() throws -> MinisqlDBProtocol { return try DatabaseFactory.getDbManager(databasePath: newDBPath()) } diff --git a/go.mod b/go.mod index 4d7ac883c..dbf434a27 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/getlantern/android-lantern go 1.19 // replace github.com/getlantern/flashlight/v7 => ../flashlight -// replace github.com/getlantern/pathdb => ../pathdb +// replace github.com/getlantern/pathdb => ../pathdbx // replace github.com/getlantern/fronted => ../fronted