Remove isSuspended property; add a try! when creating tables.

This commit is contained in:
Brent Simmons 2019-12-15 22:28:48 -08:00
parent 8c0c64f6b0
commit 1f65b3fc87
1 changed files with 1 additions and 6 deletions

View File

@ -12,17 +12,12 @@ import RSDatabase
public struct SyncDatabase { public struct SyncDatabase {
/// When SyncDatabase is suspended, database calls will crash the app.
public var isSuspended: Bool {
return queue.isSuspended
}
private let syncStatusTable: SyncStatusTable private let syncStatusTable: SyncStatusTable
private let queue: DatabaseQueue private let queue: DatabaseQueue
public init(databaseFilePath: String) { public init(databaseFilePath: String) {
let queue = DatabaseQueue(databasePath: databaseFilePath) let queue = DatabaseQueue(databasePath: databaseFilePath)
queue.runCreateStatements(SyncDatabase.tableCreationStatements) try! queue.runCreateStatements(SyncDatabase.tableCreationStatements)
queue.vacuumIfNeeded(daysBetweenVacuums: 11) queue.vacuumIfNeeded(daysBetweenVacuums: 11)
self.queue = queue self.queue = queue