mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-25 04:07:47 +00:00
Caveat documentation
This commit is contained in:
1 parent
5b3eee53c2
commit
cc68ef5872
1 file changed
+15
@@ -15,6 +15,21 @@
|
||||
/// // SELECT *, rowid FROM player
|
||||
/// let request = Player.all()
|
||||
public struct AllColumns {
|
||||
// As long as the CTE is embedded here, the following request will fail
|
||||
// at runtime, in `_columnCount(_:)`, because we can't access the number of
|
||||
// columns in the CTE:
|
||||
//
|
||||
// let association = Player.association(to: cte)
|
||||
// Player.including(required: association.select(AllColumns(), ...))
|
||||
//
|
||||
// The need for this should not be frequent. And the user has
|
||||
// two workarounds:
|
||||
//
|
||||
// - provide explicit columns in the CTE definition.
|
||||
// - prefer `annotated(with:)` when she wants to extend the selection.
|
||||
//
|
||||
// TODO: Make `cteRequestOrAssociation.select(AllColumns())` possible.
|
||||
|
||||
/// When nil, select all columns from a regular database table.
|
||||
/// When not nil, select all columns from a common table expression.
|
||||
var cte: SQLCTE?
|
||||
|
||||
Reference in new issue
Block a user