TableMapping.selectsRowID + passing tests for FTS3Record

This commit is contained in:
Gwendal Roué committed 2016-10-07 19:17:40 +02:00
1 parent a1f3d42fd0
commit 2d6abc088f
12 files changed
+634 -47

No files matched your search

@@ -236,7 +236,13 @@ extension TableMapping {
/// Returns a QueryInterfaceRequest which fetches all rows in the table.
public static func all() -> QueryInterfaceRequest<Self> {
return QueryInterfaceRequest(tableName: databaseTableName)
let selection: [SQLSelectable]
if selectsRowID {
selection = [star, Column.rowID]
} else {
selection = [star]
}
return QueryInterfaceRequest(query: QueryInterfaceSelectQueryDefinition(select: selection, from: .table(name: databaseTableName, alias: nil)))
}
/// Returns a QueryInterfaceRequest which selects *selection*.