File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change
1
+ import Core
2
+
3
+ extension Decimal : PostgreSQLDataConvertible {
4
+ /// See `PostgreSQLDataConvertible`
5
+ public static var postgreSQLDataType : PostgreSQLDataType {
6
+ return Double . postgreSQLDataType
7
+ }
8
+
9
+ /// See `PostgreSQLDataConvertible`
10
+ public static var postgreSQLDataArrayType : PostgreSQLDataType {
11
+ return Double . postgreSQLDataArrayType
12
+ }
13
+
14
+ /// See `PostgreSQLDataConvertible`
15
+ public static func convertFromPostgreSQLData( _ data: PostgreSQLData ) throws -> Decimal {
16
+ return try Decimal ( Double . convertFromPostgreSQLData ( data) )
17
+ }
18
+
19
+ /// See `PostgreSQLDataConvertible`
20
+ public func convertToPostgreSQLData( ) throws -> PostgreSQLData {
21
+ return try Double ( description) . convertToPostgreSQLData ( )
22
+ }
23
+ }
You can’t perform that action at this time.
0 commit comments