Skip to content
Snippets Groups Projects
Commit 588f5efe authored by Kateryna Kostiuk's avatar Kateryna Kostiuk
Browse files

build: fix sqlite for iOS 18

The iOS 18 (Xcode 16) introduced Expression type that conflicts
with SQLite Expression.

Change-Id: Id5e856a97df50fc119d434cd2c888e75d752a29d
parent 94f2a3e4
No related branches found
No related tags found
No related merge requests found
......@@ -27,15 +27,15 @@ typealias Conversation = (
final class ConversationDataHelper {
let table = Table("conversations")
let id = Expression<Int64>("id")
let participant = Expression<String>("participant")
let id = SQLite.Expression<Int64>("id")
let participant = SQLite.Expression<String>("participant")
// reference foreign key
let tableProfiles = Table("profiles")
let uri = Expression<String>("uri")
let uri = SQLite.Expression<String>(value: "uri")
// to migrate from legacy db
let participantId = Expression<Int64>("participant_id")
let participantId = SQLite.Expression<Int64>("participant_id")
func migrateToDBForAccount(from oldDB: Connection,
to newDB: Connection,
......
......@@ -37,25 +37,25 @@ struct Interaction {
final class InteractionDataHelper {
let table = Table("interactions")
let id = Expression<Int64>("id")
let author = Expression<String?>("author")
let duration = Expression<Int64>("duration")
let conversation = Expression<Int64>("conversation")
let timestamp = Expression<Int64>("timestamp")
let body = Expression<String>("body")
let type = Expression<String>("type")
let status = Expression<String>("status")
let daemonId = Expression<String>("daemon_id")
let incoming = Expression<Bool>("incoming")
let id = SQLite.Expression<Int64>("id")
let author = SQLite.Expression<String?>("author")
let duration = SQLite.Expression<Int64>("duration")
let conversation = SQLite.Expression<Int64>("conversation")
let timestamp = SQLite.Expression<Int64>("timestamp")
let body = SQLite.Expression<String>("body")
let type = SQLite.Expression<String>("type")
let status = SQLite.Expression<String>("status")
let daemonId = SQLite.Expression<String>("daemon_id")
let incoming = SQLite.Expression<Bool>("incoming")
// foreign keys references
let tableProfiles = Table("profiles")
let tableConversations = Table("conversations")
let uri = Expression<String>("uri")
let uri = SQLite.Expression<String>("uri")
// migrations from legacy db
let authorId = Expression<Int64>("author_id")
let conversationId = Expression<Int64>("conversation_id")
let authorId = SQLite.Expression<Int64>("author_id")
let conversationId = SQLite.Expression<Int64>("conversation_id")
func migrateToDBForAccount (from oldDB: Connection,
to newDB: Connection,
......@@ -189,7 +189,7 @@ final class InteractionDataHelper {
return interactions
}
func selectInteractions(where predicat: Expression<Bool>, dataBase: Connection) throws -> [Interaction] {
func selectInteractions(where predicat: SQLite.Expression<Bool>, dataBase: Connection) throws -> [Interaction] {
let query = table.filter(predicat)
var interactions = [Interaction]()
let items = try dataBase.prepare(query)
......@@ -261,7 +261,7 @@ final class InteractionDataHelper {
}
}
func deleteInteractions(where predicat: Expression<Bool>, dataBase: Connection) throws -> Bool {
func deleteInteractions(where predicat: SQLite.Expression<Bool>, dataBase: Connection) throws -> Bool {
let query = table.filter(predicat)
let deletedRows = try dataBase.run(query.delete())
return deletedRows > 0
......
......@@ -24,10 +24,10 @@ import SwiftyBeaver
final class ProfileDataHelper {
let contactsProfileTable = Table("profiles")
let accountProfileTable = Table("account_profile")
let uri = Expression<String>("uri")
let alias = Expression<String?>("alias")
let photo = Expression<String?>("photo")
let type = Expression<String>("type")
let uri = SQLite.Expression<String>("uri")
let alias = SQLite.Expression<String?>("alias")
let photo = SQLite.Expression<String?>("photo")
let type = SQLite.Expression<String>("type")
private let log = SwiftyBeaver.self
func dropAccountTable(accountDb: Connection) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment