mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-27 04:14:21 +00:00
Quote table name in raw SQL query
This commit is contained in:
1 parent
59f9482aa7
commit
ea41f34f3d
1 file changed
+1
-1
@@ -818,7 +818,7 @@ public struct ForeignKeyViolation: FetchableRecord, CustomStringConvertible {
|
||||
public func failureDescription(_ db: Database) throws -> String {
|
||||
// Grab detailed information, if possible, for better error message
|
||||
let originRow = try originRowID.flatMap { rowid in
|
||||
try Row.fetchOne(db, sql: "SELECT * FROM \(originTable) WHERE rowid = \(rowid)")
|
||||
try Row.fetchOne(db, sql: "SELECT * FROM \(originTable.quotedDatabaseIdentifier) WHERE rowid = \(rowid)")
|
||||
}
|
||||
let foreignKey = try db.foreignKeys(on: originTable).first(where: { foreignKey in
|
||||
foreignKey.id == foreignKeyId
|
||||
|
||||
Reference in new issue
Block a user