AnyTypedRequest
public struct AnyTypedRequest<T> : TypedRequest
A type-erased TypedRequest.
An instance of AnyTypedRequest forwards its operations to an underlying typed request, hiding its specifics.
-
The type that can convert raw database rows to fetched values
Declaration
Swift
public typealias RowDecoder = T
-
Creates a new request that wraps and forwards operations to
request
.Declaration
Swift
public init<Request>(_ request: Request) where Request: TypedRequest, Request.RowDecoder == RowDecoder
-
Creates a new request whose
prepare()
method wraps and forwards operations the argument closure.Declaration
Swift
public init(_ prepare: @escaping (Database) throws -> (SelectStatement, RowAdapter?))
-
A tuple that contains a prepared statement that is ready to be executed, and an eventual row adapter.
Declaration
Swift
public func prepare(_ db: Database) throws -> (SelectStatement, RowAdapter?)
Parameters
db
A database connection.