mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-30 04:28:44 +00:00
Improve CTE columns counting
This commit is contained in:
1 parent
b085a29c8c
commit
5e8f95ca09
1 file changed
+3
-3
@@ -191,11 +191,11 @@ extension _AllCTEColumns: SQLSelectable, Refinable {
|
||||
return columns.count
|
||||
}
|
||||
|
||||
// Compile request
|
||||
#warning("TODO: do we need to cache this CTE columnCount?")
|
||||
// Compile request. We can freely use the statement cache because we
|
||||
// do not execute the statement or modify its arguments.
|
||||
let context = SQLGenerationContext(db)
|
||||
let sql = try request.requestSQL(context, forSingleResult: false)
|
||||
let statement = try db.makeSelectStatement(sql: sql)
|
||||
let statement = try db.cachedSelectStatement(sql: sql)
|
||||
return statement.columnCount
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user