mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-22 04:00:39 +00:00
Fix failing tests for INTEGER PRIMARY KEY in WITHOUT ROWID tables
This commit is contained in:
1 parent
d4713c1fa8
commit
4373b3a49b
1 file changed
+4
-3
@@ -511,11 +511,12 @@ extension Database {
|
||||
// > DESC" clause, it does not become an alias for the rowid [...]
|
||||
//
|
||||
// FIXME: We ignore the exception, and consider all INTEGER primary
|
||||
// keys as aliases for the rowid:
|
||||
if pkColumn.type.uppercased() == "INTEGER" {
|
||||
// keys of rowid tables as aliases for the rowid:
|
||||
let tableHasRowID = try fetchTableHasRowID(table)
|
||||
if pkColumn.type.uppercased() == "INTEGER" && tableHasRowID {
|
||||
return .rowID(pkColumn)
|
||||
} else {
|
||||
return try .regular([pkColumn], tableHasRowID: fetchTableHasRowID(table))
|
||||
return .regular([pkColumn], tableHasRowID: tableHasRowID)
|
||||
}
|
||||
|
||||
default:
|
||||
|
||||
Reference in new issue
Block a user