mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-24 04:07:47 +00:00
Cleanup
This commit is contained in:
1 parent
a46b4edb0a
commit
a3ad726111
4 files changed
+72
-152
No files matched your search
@@ -1,9 +1,7 @@
|
||||
/// A QueryInterfaceRequest describes an SQL query.
|
||||
///
|
||||
/// See https://github.com/groue/GRDB.swift#the-query-interface
|
||||
public struct QueryInterfaceRequest<T> : TypedRequest {
|
||||
public typealias RowDecoder = T
|
||||
|
||||
public struct QueryInterfaceRequest<T> {
|
||||
let query: QueryInterfaceSelectQueryDefinition
|
||||
|
||||
init(query: QueryInterfaceSelectQueryDefinition) {
|
||||
@@ -11,18 +9,20 @@ public struct QueryInterfaceRequest<T> : TypedRequest {
|
||||
}
|
||||
}
|
||||
|
||||
extension QueryInterfaceRequest : SQLSelectQuery {
|
||||
extension QueryInterfaceRequest : TypedRequest {
|
||||
public typealias RowDecoder = T
|
||||
|
||||
/// This function is an implementation detail of the query interface.
|
||||
/// Do not use it directly.
|
||||
/// A tuple that contains a prepared statement that is ready to be
|
||||
/// executed, and an eventual row adapter.
|
||||
public func prepare(_ db: Database) throws -> (SelectStatement, RowAdapter?) {
|
||||
return try query.prepare(db)
|
||||
}
|
||||
|
||||
/// The number of rows fetched by the request.
|
||||
///
|
||||
/// See https://github.com/groue/GRDB.swift/#the-query-interface
|
||||
///
|
||||
/// # Low Level Query Interface
|
||||
///
|
||||
/// See SQLSelectQuery.selectQuerySQL(_)
|
||||
public func selectQuerySQL(_ arguments: inout StatementArguments?) -> String {
|
||||
return query.selectQuerySQL(&arguments)
|
||||
/// - parameter db: A database connection.
|
||||
public func fetchCount(_ db: Database) throws -> Int {
|
||||
return try query.fetchCount(db)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -230,18 +230,6 @@ extension QueryInterfaceRequest {
|
||||
}
|
||||
}
|
||||
|
||||
extension QueryInterfaceRequest {
|
||||
|
||||
// MARK: Counting
|
||||
|
||||
/// The number of rows fetched by the request.
|
||||
///
|
||||
/// - parameter db: A database connection.
|
||||
public func fetchCount(_ db: Database) throws -> Int {
|
||||
return try query.fetchCount(db)
|
||||
}
|
||||
}
|
||||
|
||||
extension QueryInterfaceRequest {
|
||||
|
||||
// MARK: Deleting
|
||||
|
||||
Reference in new issue
Block a user