Skip to content

Commit 388ca50

Browse files
committed
update tests
1 parent 6ec1677 commit 388ca50

File tree

5 files changed

+539
-495
lines changed

5 files changed

+539
-495
lines changed

Sources/PostgreSQL/Connection/PostgreSQLConnection+NotifyAndListen.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ extension PostgreSQLConnection {
5151
/// - message: String message to send to subscribers.
5252
/// - returns: A future that signals completion of the send.
5353
public func notify(_ channel: String, message: String) -> Future<Void> {
54-
return simpleQuery("NOTIFY \"\(channel)\" '\(message)'")
54+
return simpleQuery("NOTIFY \"\(channel)\", '\(message)'")
5555
}
5656
}
5757

Sources/PostgreSQL/SQL/PostgreSQLGeneric.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ public typealias PostgreSQLBinaryOperator = GenericSQLBinaryOperator
33

44
/// See `SQLQuery`.
55
public typealias PostgreSQLColumnConstraintAlgorithm = GenericSQLColumnConstraintAlgorithm<
6-
PostgreSQLExpression, PostgreSQLCollation, PostgreSQLPrimaryKey, PostgreSQLForeignKey
6+
PostgreSQLExpression, PostgreSQLCollation, PostgreSQLPrimaryKeyDefault, PostgreSQLForeignKey
77
>
88

99
/// See `SQLQuery`.
@@ -88,7 +88,7 @@ public typealias PostgreSQLSelectExpression = GenericSQLSelectExpression<Postgre
8888

8989
/// See `SQLQuery`.
9090
public typealias PostgreSQLTableConstraintAlgorithm = GenericSQLTableConstraintAlgorithm<
91-
PostgreSQLIdentifier, PostgreSQLExpression, PostgreSQLCollation, PostgreSQLPrimaryKey, PostgreSQLForeignKey
91+
PostgreSQLIdentifier, PostgreSQLExpression, PostgreSQLCollation, PostgreSQLForeignKey
9292
>
9393

9494
/// See `SQLQuery`.

Sources/PostgreSQL/SQL/PostgreSQLPrimaryKey.swift

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
1-
public enum PostgreSQLPrimaryKey: SQLPrimaryKey {
1+
public enum PostgreSQLPrimaryKeyDefault: SQLPrimaryKeyDefault {
22
public enum Generated {
33
case byDefault
44
case always
55
}
6-
case none
76
case generated(Generated)
87

9-
public static func primaryKey() -> PostgreSQLPrimaryKey {
8+
public static var `default`: PostgreSQLPrimaryKeyDefault {
109
return .generated(.byDefault)
1110
}
1211

1312
public func serialize(_ binds: inout [Encodable]) -> String {
1413
switch self {
15-
case .none: return ""
1614
case .generated(let generated):
1715
switch generated {
1816
case .always: return "GENERATED ALWAYS AS IDENTITY"

Sources/PostgreSQL/SQL/PostgreSQLQuery+DataType.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
public enum PostgreSQLDataType: SQLDataType {
22
public static func dataType(appropriateFor type: Any.Type) -> PostgreSQLDataType? {
33
guard let type = type as? PostgreSQLDataTypeStaticRepresentable.Type else {
4-
return nil
4+
return .jsonb
55
}
66
return type.postgreSQLDataType
77
}

0 commit comments

Comments
 (0)