     var userInfo: [CodingUserInfoKey : Any] { return [:] }
     
     func container<Key>(keyedBy type: Key.Type) throws -> KeyedDecodingContainer<Key> {
-        throw DecodingError.typeMismatch(
-            UnkeyedDecodingContainer.self,
-            DecodingError.Context(codingPath: codingPath, debugDescription: "keyed decoding is not supported"))
+        throw JSONDecodingRequiredError()
     }
     
     func unkeyedContainer() throws -> UnkeyedDecodingContainer {
-        throw DecodingError.typeMismatch(
-            UnkeyedDecodingContainer.self,
-            DecodingError.Context(codingPath: codingPath, debugDescription: "unkeyed decoding is not supported"))
+        throw JSONDecodingRequiredError()
     }
     
     func singleValueContainer() throws -> SingleValueDecodingContainer {
         return RowSingleValueDecodingContainer(row: row, codingPath: codingPath, column: codingPath.last!)
     }
 }
+
+private struct JSONDecodingRequiredError: Error { }
 
 extension FetchableRecord where Self: Decodable {
     /// Initializes a record from `row`.

    }
    
    func unkeyedContainer() throws -> UnkeyedDecodingContainer {
        throw DecodingError.typeMismatch(
            UnkeyedDecodingContainer.self,
            DecodingError.Context(codingPath: codingPath, debugDescription: "unkeyed decoding is not supported"))
    }
    
    func singleValueContainer() throws -> SingleValueDecodingContainer {
        throw DecodingError.typeMismatch(
            RowDecoder.self,
            DecodingError.Context(codingPath: codingPath, debugDescription: "single value decoding is not supported"))
    }
}


                    // value here (string, int, double, data, null). If such an
                    // error happens, we'll switch to JSON decoding.
                    return try T(from: RowSingleValueDecoder(row: row, codingPath: codingPath + [key]))
                } catch let error as JSONDecodingRequiredError {
                    if let data = row.dataNoCopy(atIndex: index) {
                        return try JSONDecoder().decode(type.self, from: data)
                    } else {
                        throw error
