mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-25 04:07:47 +00:00
Fix #1159
This commit is contained in:
1 parent
9a4e1f7806
commit
9dc6fbd7f9
2 files changed
+10
-2
No files matched your search
@@ -49,7 +49,13 @@ final class SchedulingWatchdog {
|
||||
file: StaticString = #file,
|
||||
line: UInt = #line)
|
||||
{
|
||||
GRDBPrecondition(current?.allows(db) ?? false, message(), file: file, line: line)
|
||||
GRDBPrecondition(allows(db), message(), file: file, line: line)
|
||||
}
|
||||
|
||||
/// Returns true iff the database argument can be used in the current
|
||||
/// dispatch queue.
|
||||
static func allows(_ db: Database) -> Bool {
|
||||
current?.allows(db) ?? false
|
||||
}
|
||||
|
||||
static var current: SchedulingWatchdog? {
|
||||
|
||||
@@ -382,7 +382,9 @@ public typealias SelectStatement = Statement
|
||||
public typealias UpdateStatement = Statement
|
||||
|
||||
extension Statement: CustomStringConvertible {
|
||||
public var description: String { sql }
|
||||
public var description: String {
|
||||
SchedulingWatchdog.allows(database) ? sql : "Statement"
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Select Statements
|
||||
|
||||
Reference in new issue
Block a user