Skip to content

Commit 185d009

Browse files
JaapWijnentanner0101
authored andcommitted
conform PostgresData to PostgresDataConvertible (#51)
* work in progress * return fatal error on static postgres data type
1 parent ec382c1 commit 185d009

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Sources/PostgresNIO/Data/PostgresData.swift

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,17 @@ public struct PostgresData: CustomStringConvertible, CustomDebugStringConvertibl
7979
return self.description
8080
}
8181
}
82+
83+
extension PostgresData: PostgresDataConvertible {
84+
public static var postgresDataType: PostgresDataType {
85+
fatalError("PostgresData cannot be statically represented as a single data type")
86+
}
87+
88+
public init?(postgresData: PostgresData) {
89+
self = postgresData
90+
}
91+
92+
public var postgresData: PostgresData? {
93+
return self
94+
}
95+
}

0 commit comments

Comments
 (0)