import Foundation
import Shared

// swiftlint: disable force_try
extension DBConnection {
    public static let main: DBConnection = {
        let dbURL = try! mainDbURL()

        if (!FileManager.default.fileExists(atPath: dbURL.path)) && (!createIfNotExist) {
            return try! DBConnection.initialize(dbPath: ":memory:")
        } else {
            return try! DBConnection.initialize(dbPath: dbURL.path)
        }
    }()
}
