Skip to content

Commit

Permalink
Updates to be compatible with SQLKit 3.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
m-barthelemy committed Apr 26, 2020
1 parent ddce52e commit 9451c03
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ let package = Package(
dependencies: [
.package(url: "https://github.com/vapor/vapor.git", from: "4.0.0"),
.package(url: "https://github.com/vapor/fluent.git", from: "4.0.0-rc.2"),
.package(url: "https://github.com/vapor/sql-kit.git", from: "3.0.0-rc"),
.package(url: "https://github.com/vapor/sql-kit.git", from: "3.0.0"),
.package(url: "https://github.com/vapor/queues.git", from: "1.0.0"),
],
targets: [
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# QueuesFluentDriver

**Note**: This package is still experimental. Please do open an issue if something doesn't work as expected.
**Note**: This package is still young. Please do open an issue if something doesn't work as expected.



Expand Down Expand Up @@ -40,7 +40,7 @@ let package = Package(
...
dependencies: [
...
.package(url: "https://github.com/m-barthelemy/vapor-queues-fluent-driver.git", from: "0.3.0"),
.package(url: "https://github.com/m-barthelemy/vapor-queues-fluent-driver.git", from: "0.3.2"),
...
],
targets: [
Expand Down
8 changes: 4 additions & 4 deletions Sources/QueuesFluentDriver/FluentQueue.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ extension FluentQueue: Queue {
.select ()
.column ("\(FieldKey.jobId)")
.from (JobModel.schema)
.where ("\(FieldKey.state)", .equal, SQLBind(QueuesFluentJobState.pending))
.where ("\(FieldKey.queue)", .equal, SQLBind(self.queueName.string))
.where (SQLColumn("\(FieldKey.state)"), .equal, SQLBind(QueuesFluentJobState.pending))
.where (SQLColumn("\(FieldKey.queue)"), .equal, SQLBind(self.queueName.string))
.orderBy("\(FieldKey.createdAt)")
.limit (1)
if self.dbType != .sqlite {
Expand Down Expand Up @@ -109,9 +109,9 @@ extension FluentQueue: Queue {
var query = db
.select()
.from (JobModel.schema)
.where ("\(FieldKey.state)", .equal, SQLBind(state))
.where (SQLColumn("\(FieldKey.state)"), .equal, SQLBind(state))
if let queue = queue {
query = query.where("\(FieldKey.queue)", .equal, SQLBind(queue))
query = query.where(SQLColumn("\(FieldKey.queue)"), .equal, SQLBind(queue))
}
if self.dbType != .sqlite {
query = query.lockingClause(SQLSkipLocked.forShareSkipLocked)
Expand Down
1 change: 0 additions & 1 deletion Sources/QueuesFluentDriver/SQLExpressionExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ struct SQLUpdateReturningExpression: SQLExpression {
}
}


extension SQLUpdateBuilder {
func returning(_ expression: SqlReturning) -> Self {
if let existing = self.predicate {
Expand Down

0 comments on commit 9451c03

Please sign in to comment.