Skip to content

Commit ceb5f56

Browse files
author
Nathan Fallet
authored
Merge pull request #826 from ReDetection/patch-1
2 parents adec7e6 + 7a30713 commit ceb5f56

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sources/SQLite/Typed/Coding.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ fileprivate class SQLiteEncoder: Encoder {
155155
}
156156

157157
func encode(_ value: Int64, forKey key: Key) throws {
158-
throw EncodingError.invalidValue(value, EncodingError.Context(codingPath: self.codingPath, debugDescription: "encoding an Int64 is not supported"))
158+
self.encoder.setters.append(Expression(key.stringValue) <- value)
159159
}
160160

161161
func encode(_ value: UInt, forKey key: Key) throws {
@@ -252,7 +252,7 @@ fileprivate class SQLiteDecoder : Decoder {
252252
}
253253

254254
func decode(_ type: Int64.Type, forKey key: Key) throws -> Int64 {
255-
throw DecodingError.typeMismatch(type, DecodingError.Context(codingPath: self.codingPath, debugDescription: "decoding an UInt64 is not supported"))
255+
return try self.row.get(Expression(key.stringValue))
256256
}
257257

258258
func decode(_ type: UInt.Type, forKey key: Key) throws -> UInt {

0 commit comments

Comments
 (0)