We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 64f9c20 commit 390c22cCopy full SHA for 390c22c
Sources/PostgreSQL/Data/PostgreSQLData+Decimal.swift
@@ -0,0 +1,23 @@
1
+import Core
2
+
3
+extension Decimal: PostgreSQLDataConvertible {
4
+ /// See `PostgreSQLDataConvertible`
5
+ public static var postgreSQLDataType: PostgreSQLDataType {
6
+ return Double.postgreSQLDataType
7
+ }
8
9
10
+ public static var postgreSQLDataArrayType: PostgreSQLDataType {
11
+ return Double.postgreSQLDataArrayType
12
13
14
15
+ public static func convertFromPostgreSQLData(_ data: PostgreSQLData) throws -> Decimal {
16
+ return try Decimal(Double.convertFromPostgreSQLData(data))
17
18
19
20
+ public func convertToPostgreSQLData() throws -> PostgreSQLData {
21
+ return try Double(description).convertToPostgreSQLData()
22
23
+}
0 commit comments