Skip to content

Commit

Permalink
publicize QueryBuilder CRUD methods
Browse files Browse the repository at this point in the history
  • Loading branch information
tanner0101 committed Jun 16, 2018
1 parent 305ebf1 commit 04c44c6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Sources/Fluent/QueryBuilder/QueryBuilder+Model.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ extension QueryBuilder where Result: Model, Result.Database == Database {
/// - parameters:
/// - model: `Model` to save.
/// - returns: A `Future` containing the saved `Model`.
internal func save(_ model: Result) -> Future<Result> {
public func save(_ model: Result) -> Future<Result> {
if model.fluentID != nil {
return update(model)
} else {
Expand All @@ -27,7 +27,7 @@ extension QueryBuilder where Result: Model, Result.Database == Database {
/// - parameters:
/// - model: `Model` to create.
/// - returns: A `Future` containing the created `Model`.
internal func create(_ model: Result) -> Future<Result> {
public func create(_ model: Result) -> Future<Result> {
Database.queryActionApply(Database.queryActionCreate, to: &query)
var copy: Result
if Result.createdAtKey != nil || Result.updatedAtKey != nil {
Expand Down Expand Up @@ -70,7 +70,7 @@ extension QueryBuilder where Result: Model, Result.Database == Database {
/// - model: `Model` to update.
/// - originalID: Specify the original ID if the ID has changed.
/// - returns: A `Future` containing the created `Model`.
internal func update(_ model: Result, originalID: Result.ID? = nil) -> Future<Result> {
public func update(_ model: Result, originalID: Result.ID? = nil) -> Future<Result> {
Database.queryActionApply(Database.queryActionUpdate, to: &query)
var copy: Result
if Result.updatedAtKey != nil {
Expand Down

0 comments on commit 04c44c6

Please sign in to comment.