Trim SQL in DatabaseError descriptoin

This commit is contained in:
Gwendal Roué committed 2023-10-08 20:07:59 +02:00
1 parent e22bf8fe0a
commit c7047c4b33
2 files changed
+3 -3

No files matched your search

+2 -2
View File
@@ -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)"
+1 -1
View File
@@ -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`
""")
}
}