Skip to content

Commit 6f0f1bf

Browse files
committed
add new QuerySupporting requirements
1 parent 4854e17 commit 6f0f1bf

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ let package = Package(
99
],
1010
dependencies: [
1111
// 🌎 Utility package containing tools for byte manipulation, Codable, OS APIs, and debugging.
12-
.package(url: "https://github.com/vapor/core.git", from: "3.0.0"),
12+
.package(url: "https://github.com/vapor/core.git", .branch("fluent-gm")),
1313

1414
// Swift ORM framework (queries, models, and relations) for building NoSQL and SQL database integrations.
1515
.package(url: "https://github.com/vapor/fluent.git", .branch("gm")),

Sources/FluentPostgreSQL/PostgreSQLDatabase+Fluent.swift

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,9 @@ extension PostgreSQLDatabase: QuerySupporting & JoinSupporting & MigrationSuppor
228228
return "MAX"
229229
}
230230

231-
public static func queryDataSet(_ column: PostgreSQLQuery.Column, to data: Encodable, on query: inout PostgreSQLQuery.FluentQuery) {
231+
public static func queryDataSet<E>(_ column: PostgreSQLQuery.Column, to data: E, on query: inout PostgreSQLQuery.FluentQuery)
232+
where E: Encodable
233+
{
232234
// FIXME: ("Allow query data set to throw if needed.")
233235
query.values[column.name] = try! .bind(data)
234236
}
@@ -276,7 +278,9 @@ extension PostgreSQLDatabase: QuerySupporting & JoinSupporting & MigrationSuppor
276278
return .notIn
277279
}
278280

279-
public static func queryFilterValue(_ encodables: [Encodable]) -> PostgreSQLQuery.Value {
281+
public static func queryFilterValue<E>(_ encodables: [E]) -> PostgreSQLQuery.Value
282+
where E: Encodable
283+
{
280284
// FIXME: ("Fix non throwing binds conversion.")
281285
return try! .binds(encodables)
282286
}
@@ -317,6 +321,10 @@ extension PostgreSQLDatabase: QuerySupporting & JoinSupporting & MigrationSuppor
317321
return .or
318322
}
319323

324+
public static func queryDefaultFilterRelation(_ relation: PostgreSQLQuery.Predicate.Relation, on: inout PostgreSQLQuery.FluentQuery) {
325+
// skip
326+
}
327+
320328
public static func queryFilterGroup(_ op: PostgreSQLQuery.Predicate.Relation, _ filters: [PostgreSQLQuery.Predicate]) -> PostgreSQLQuery.Predicate {
321329
return .group(op, filters)
322330
}

0 commit comments

Comments
 (0)