We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6b3f436 commit f2dcbbbCopy full SHA for f2dcbbb
Sources/StructuredQueriesCore/QueryBindable+Foundation.swift
@@ -23,4 +23,20 @@ extension URL: QueryBindable {
23
}
24
25
26
+extension Decimal: QueryBindable {
27
+ public var queryBinding: QueryBinding {
28
+ .text(description)
29
+ }
30
+
31
+ public init(decoder: inout some QueryDecoder) throws {
32
+ let string = try String(decoder: &decoder)
33
+ guard let decimal = Decimal(string: string) else {
34
+ throw InvalidDecimal()
35
36
+ self = decimal
37
38
+}
39
40
private struct InvalidURL: Error {}
41
42
+private struct InvalidDecimal: Error {}
0 commit comments