mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-28 04:24:20 +00:00
Documentation
This commit is contained in:
1 parent
40f6b351ea
commit
e62cfe086c
1 file changed
+19
@@ -1,3 +1,22 @@
|
||||
/// QueryInterfaceRequest is the type of requests generated by TableRecord:
|
||||
///
|
||||
/// struct Player: TableRecord { ... }
|
||||
/// let playerRequest = Player.all() // QueryInterfaceRequest<Player>
|
||||
///
|
||||
/// It wraps an SQLSelectQuery, and has an attached type.
|
||||
///
|
||||
/// The attached type helps decoding raw database values:
|
||||
///
|
||||
/// try dbQueue.read { db in
|
||||
/// try playerRequest.fetchAll(db) // [Player]
|
||||
/// try playerRequest.asRequest(of: Row.self).fetchAll(db) // [Row]
|
||||
/// }
|
||||
///
|
||||
/// The attached type also helps the compiler validate associated requests:
|
||||
///
|
||||
/// playerRequest.including(required: Player.team) // OK
|
||||
/// fruitRequest.including(required: Player.team) // Does not compile
|
||||
|
||||
/// A QueryInterfaceRequest describes an SQL query.
|
||||
///
|
||||
/// See https://github.com/groue/GRDB.swift#the-query-interface
|
||||
|
||||
Reference in new issue
Block a user