Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions Sources/SQLite/SQLiteDatabase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ public final class SQLiteDatabase: DatabaseProtocol, @unchecked Sendable {
public static func makeShared(
path: String,
busyTimeout: TimeInterval = 5,
collationSequences: [String: @Sendable (String, String) -> ComparisonResult] = [:],
observeLifecycleEvents: Bool = true
collationSequences: [String: @Sendable (String, String) -> ComparisonResult] = [:]
) throws -> SQLiteDatabase {
guard path != ":memory:" else {
throw SQLiteError.SQLITE_IOERR
Expand All @@ -72,8 +71,7 @@ public final class SQLiteDatabase: DatabaseProtocol, @unchecked Sendable {
database = try SQLiteDatabase(
path: url.path,
busyTimeout: busyTimeout,
collationSequences: collationSequences,
observeLifecycleEvents: observeLifecycleEvents
collationSequences: collationSequences
)
} catch {
databaseError = error
Expand All @@ -97,8 +95,7 @@ public final class SQLiteDatabase: DatabaseProtocol, @unchecked Sendable {
public init(
path: String = ":memory:",
busyTimeout: TimeInterval = 5,
collationSequences: [String: @Sendable (String, String) -> ComparisonResult] = [:],
observeLifecycleEvents: Bool = true
collationSequences: [String: @Sendable (String, String) -> ComparisonResult] = [:]
) throws {
database = try Self.open(
at: path,
Expand All @@ -119,9 +116,7 @@ public final class SQLiteDatabase: DatabaseProtocol, @unchecked Sendable {
try checkIsSQLiteVersionSupported(sqliteVersion)
precondition(enforcesForeignKeyConstraints)

if observeLifecycleEvents {
registerForAppNotifications()
}
registerForAppNotifications()
changeNotifier.start()
}

Expand Down Expand Up @@ -547,7 +542,7 @@ public extension SQLiteDatabase {

// MARK: - App Notifications

#if canImport(UIKit)
#if canImport(UIKit) && !targetEnvironment(macCatalyst)

import UIKit

Expand Down