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 #79 from madsodgaard/rawsql-binds
Browse files Browse the repository at this point in the history
Allow parameterized queries on RawSQLBuilder
  • Loading branch information
steffendsommer authored Oct 16, 2019
2 parents 3f020bd + 4aa05a6 commit 1e3394e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Sources/Paginator/Paginatable/RawSQLBuilderPaginatable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,18 @@ public class RawSQLBuilder<Database, Result> where

self.sqlRawCountBuilder = connection.raw(countQuery)
}

public func bind(_ encodable: Encodable) -> Self {
_ = sqlRawBuilder.bind(encodable)
_ = sqlRawCountBuilder?.bind(encodable)
return self
}

public func binds(_ encodables: [Encodable]) -> Self {
_ = sqlRawBuilder.binds(encodables)
_ = sqlRawCountBuilder?.binds(encodables)
return self
}
}

public extension RawSQLBuilder {
Expand Down

0 comments on commit 1e3394e

Please sign in to comment.