Skip to content
This repository has been archived by the owner on Apr 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #72 from madsodgaard/hotfix/fix-rawsql-access-modi…
Browse files Browse the repository at this point in the history
…fiers

Change RawSQLBuilder access modifiers to public
  • Loading branch information
steffendsommer authored Jun 17, 2019
2 parents 965c23e + cbc5aab commit 34fc03d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions Sources/Paginator/Paginatable/RawSQLBuilderPaginatable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Fluent
import Vapor
import SQL

protocol RawSQLBuilderPaginatable: Paginatable {
public protocol RawSQLBuilderPaginatable: Paginatable {
associatedtype PaginatableMetaData

static func paginate<D: Database, Result>(
Expand All @@ -12,7 +12,7 @@ protocol RawSQLBuilderPaginatable: Paginatable {
) throws -> Future<([Result], PaginatableMetaData)>
}

class RawSQLBuilder<Database, Result> where
public class RawSQLBuilder<Database, Result> where
Database: DatabaseKit.Database,
Database.Connection: SQLConnectable,
Result: Decodable
Expand All @@ -24,7 +24,7 @@ class RawSQLBuilder<Database, Result> where
let count: Int
}

init(query: String, countQuery: String?, connection: Database.Connection) {
public init(query: String, countQuery: String?, connection: Database.Connection) {
self.sqlRawBuilder = connection.raw(query)

guard let countQuery = countQuery else {
Expand All @@ -36,7 +36,7 @@ class RawSQLBuilder<Database, Result> where
}
}

extension RawSQLBuilder {
public extension RawSQLBuilder {
func count(for req: Request) throws -> EventLoopFuture<Int> {
guard let sqlRawCountBuilder = sqlRawCountBuilder else {
throw Abort(HTTPStatus.internalServerError, reason: "Cannot compute count")
Expand Down Expand Up @@ -73,11 +73,11 @@ extension RawSQLBuilder {
}

extension RawSQLBuilder: Transformable {
typealias TransformableQuery = RawSQLBuilder<Database, Result>
typealias TransformableQueryResult = Result
public typealias TransformableQuery = RawSQLBuilder<Database, Result>
public typealias TransformableQueryResult = Result
}

extension TransformingQuery {
public extension TransformingQuery {
func paginate<P: Paginator, Database>(
for req: Request
) throws -> Future<P> where
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Vapor

extension OffsetPaginator: RawSQLBuilderPaginatable {
// This shouldn't be called directly - please use the extension on QueryBuilder instead.
static func paginate<D: Database, Result>(
public static func paginate<D: Database, Result>(
source: RawSQLBuilder<D, Result>,
count: Future<Int>,
on req: Request
Expand Down

0 comments on commit 34fc03d

Please sign in to comment.