diff --git a/Package.swift b/Package.swift index 8bd4182..ed27040 100644 --- a/Package.swift +++ b/Package.swift @@ -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: [ diff --git a/README.md b/README.md index 2185c0e..494d63f 100644 --- a/README.md +++ b/README.md @@ -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. @@ -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: [ diff --git a/Sources/QueuesFluentDriver/FluentQueue.swift b/Sources/QueuesFluentDriver/FluentQueue.swift index 4304466..0dd764d 100644 --- a/Sources/QueuesFluentDriver/FluentQueue.swift +++ b/Sources/QueuesFluentDriver/FluentQueue.swift @@ -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 { @@ -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) diff --git a/Sources/QueuesFluentDriver/SQLExpressionExtensions.swift b/Sources/QueuesFluentDriver/SQLExpressionExtensions.swift index f5a269a..147560b 100644 --- a/Sources/QueuesFluentDriver/SQLExpressionExtensions.swift +++ b/Sources/QueuesFluentDriver/SQLExpressionExtensions.swift @@ -53,7 +53,6 @@ struct SQLUpdateReturningExpression: SQLExpression { } } - extension SQLUpdateBuilder { func returning(_ expression: SqlReturning) -> Self { if let existing = self.predicate {