Skip to content

Commit 6b7ccf1

Browse files
authored
Merge pull request vapor#105 from vapor/sql-2-1
sql 2.1 updates
2 parents 4b880e6 + dca934a commit 6b7ccf1

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

Sources/PostgreSQL/SQL/PostgreSQLDropIndex.swift

+6-6
Original file line numberDiff line numberDiff line change
@@ -13,29 +13,29 @@ public struct PostgreSQLDropIndex: SQLDropIndex {
1313
}
1414

1515
/// Builds `PostgreSQLDropIndex` queries.
16-
public final class PostgreSQLDropIndexBuilder<Connection>: SQLQueryBuilder
17-
where Connection: SQLConnection, Connection.Query == PostgreSQLQuery
16+
public final class PostgreSQLDropIndexBuilder<Connectable>: SQLQueryBuilder
17+
where Connectable: SQLConnectable, Connectable.Connection.Query == PostgreSQLQuery
1818
{
1919
/// `AlterTable` query being built.
2020
public var dropIndex: PostgreSQLDropIndex
2121

2222
/// See `SQLQueryBuilder`.
23-
public var connection: Connection
23+
public var connectable: Connectable
2424

2525
/// See `SQLQueryBuilder`.
2626
public var query: PostgreSQLQuery {
2727
return .dropIndex(dropIndex)
2828
}
2929

3030
/// Creates a new `SQLCreateIndexBuilder`.
31-
public init(_ dropIndex: PostgreSQLDropIndex, on connection: Connection) {
31+
public init(_ dropIndex: PostgreSQLDropIndex, on connectable: Connectable) {
3232
self.dropIndex = dropIndex
33-
self.connection = connection
33+
self.connectable = connectable
3434
}
3535
}
3636

3737

38-
extension SQLConnection where Query == PostgreSQLQuery {
38+
extension SQLConnectable where Connection.Query == PostgreSQLQuery {
3939
/// Creates a `PostgreSQLDropIndexBuilder` for this connection.
4040
public func drop(index identifier: PostgreSQLIdentifier) -> PostgreSQLDropIndexBuilder<Self> {
4141
return .init(PostgreSQLDropIndex(identifier: identifier), on: self)

Sources/PostgreSQL/SQL/PostgreSQLInsert.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public struct PostgreSQLInsert: SQLInsert {
5050
}
5151
}
5252

53-
extension SQLInsertBuilder where Connection.Query.Insert == PostgreSQLInsert {
53+
extension SQLInsertBuilder where Connectable.Connection.Query.Insert == PostgreSQLInsert {
5454
/// Adds a `RETURNING` expression to the insert query.
5555
public func returning(_ exprs: PostgreSQLSelectExpression...) -> Self {
5656
insert.returning += exprs

Sources/PostgreSQL/SQL/PostgreSQLUpsert.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public struct PostgreSQLUpsert: SQLSerializable {
2828
}
2929
}
3030

31-
extension SQLInsertBuilder where Connection.Query.Insert == PostgreSQLInsert {
31+
extension SQLInsertBuilder where Connectable.Connection.Query.Insert == PostgreSQLInsert {
3232
/// Adds an `ON CONFLICT ... DO UPDATE SET` clause to the insert.
3333
public func onConflict<T, V, E>(_ key: KeyPath<T, V>, set value: E) -> Self where
3434
T: PostgreSQLTable, E: Encodable

0 commit comments

Comments
 (0)