mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-29 04:24:21 +00:00
Trim SQL in DatabaseError descriptoin
This commit is contained in:
1 parent
e22bf8fe0a
commit
c7047c4b33
2 files changed
+3
-3
No files matched your search
@@ -549,7 +549,7 @@ extension DatabaseError: CustomStringConvertible {
|
||||
description += ": \(message)"
|
||||
}
|
||||
if let sql {
|
||||
description += " - while executing `\(sql)`"
|
||||
description += " - while executing `\(sql.trimmedSQLStatement)`"
|
||||
}
|
||||
if publicStatementArguments, let arguments, !arguments.isEmpty {
|
||||
description += " with arguments \(arguments)"
|
||||
@@ -577,7 +577,7 @@ extension DatabaseError: CustomStringConvertible {
|
||||
description += ": \(message)"
|
||||
}
|
||||
if let sql {
|
||||
description += " - while executing `\(sql)`"
|
||||
description += " - while executing `\(sql.trimmedSQLStatement)`"
|
||||
}
|
||||
if let arguments, !arguments.isEmpty {
|
||||
description += " with arguments \(arguments)"
|
||||
|
||||
@@ -388,7 +388,7 @@ class UpdateStatementTests : GRDBTestCase {
|
||||
XCTAssertEqual(error.description, """
|
||||
SQLite error 21: Multiple statements found. To execute multiple statements, \
|
||||
use Database.execute(sql:) or Database.allStatements(sql:) instead. \
|
||||
- while executing `UPDATE persons SET age = 1; UPDATE persons SET age = 2;`
|
||||
- while executing `UPDATE persons SET age = 1; UPDATE persons SET age = 2`
|
||||
""")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user