@@ -9,7 +9,12 @@ extension UInt8: PSQLCodable {
9
9
. binary
10
10
}
11
11
12
- static func decode( from buffer: inout ByteBuffer , type: PostgresDataType , format: PostgresFormat , context: PSQLDecodingContext ) throws -> Self {
12
+ static func decode< JSONDecoder: PostgresJSONDecoder > (
13
+ from buffer: inout ByteBuffer ,
14
+ type: PostgresDataType ,
15
+ format: PostgresFormat ,
16
+ context: PostgresDecodingContext < JSONDecoder >
17
+ ) throws -> Self {
13
18
switch type {
14
19
case . bpchar, . char:
15
20
guard buffer. readableBytes == 1 , let value = buffer. readInteger ( as: UInt8 . self) else {
@@ -37,7 +42,12 @@ extension Int16: PSQLCodable {
37
42
. binary
38
43
}
39
44
40
- static func decode( from buffer: inout ByteBuffer , type: PostgresDataType , format: PostgresFormat , context: PSQLDecodingContext ) throws -> Self {
45
+ static func decode< JSONDecoder: PostgresJSONDecoder > (
46
+ from buffer: inout ByteBuffer ,
47
+ type: PostgresDataType ,
48
+ format: PostgresFormat ,
49
+ context: PostgresDecodingContext < JSONDecoder >
50
+ ) throws -> Self {
41
51
switch ( format, type) {
42
52
case ( . binary, . int2) :
43
53
guard buffer. readableBytes == 2 , let value = buffer. readInteger ( as: Int16 . self) else {
@@ -68,7 +78,12 @@ extension Int32: PSQLCodable {
68
78
. binary
69
79
}
70
80
71
- static func decode( from buffer: inout ByteBuffer , type: PostgresDataType , format: PostgresFormat , context: PSQLDecodingContext ) throws -> Self {
81
+ static func decode< JSONDecoder: PostgresJSONDecoder > (
82
+ from buffer: inout ByteBuffer ,
83
+ type: PostgresDataType ,
84
+ format: PostgresFormat ,
85
+ context: PostgresDecodingContext < JSONDecoder >
86
+ ) throws -> Self {
72
87
switch ( format, type) {
73
88
case ( . binary, . int2) :
74
89
guard buffer. readableBytes == 2 , let value = buffer. readInteger ( as: Int16 . self) else {
@@ -104,7 +119,12 @@ extension Int64: PSQLCodable {
104
119
. binary
105
120
}
106
121
107
- static func decode( from buffer: inout ByteBuffer , type: PostgresDataType , format: PostgresFormat , context: PSQLDecodingContext ) throws -> Self {
122
+ static func decode< JSONDecoder: PostgresJSONDecoder > (
123
+ from buffer: inout ByteBuffer ,
124
+ type: PostgresDataType ,
125
+ format: PostgresFormat ,
126
+ context: PostgresDecodingContext < JSONDecoder >
127
+ ) throws -> Self {
108
128
switch ( format, type) {
109
129
case ( . binary, . int2) :
110
130
guard buffer. readableBytes == 2 , let value = buffer. readInteger ( as: Int16 . self) else {
@@ -152,7 +172,12 @@ extension Int: PSQLCodable {
152
172
. binary
153
173
}
154
174
155
- static func decode( from buffer: inout ByteBuffer , type: PostgresDataType , format: PostgresFormat , context: PSQLDecodingContext ) throws -> Self {
175
+ static func decode< JSONDecoder: PostgresJSONDecoder > (
176
+ from buffer: inout ByteBuffer ,
177
+ type: PostgresDataType ,
178
+ format: PostgresFormat ,
179
+ context: PostgresDecodingContext < JSONDecoder >
180
+ ) throws -> Self {
156
181
switch ( format, type) {
157
182
case ( . binary, . int2) :
158
183
guard buffer. readableBytes == 2 , let value = buffer. readInteger ( as: Int16 . self) else {
0 commit comments