         }
     }
     
+    /// Checks if the key exists in this row
     func contains(_ key: Key) -> Bool {
         return (try? decoder.either.getKeyed().fields.contains { pair in
             return pair.field.name == key.stringValue

import Foundation

class RowDecoder : DecoderHelper {
    required init(keyed: Row, lossyIntegers: Bool, lossyStrings: Bool) throws {
        self.either = .keyed(keyed)
        self.lossyIntegers = lossyIntegers
        self.lossyStrings = lossyStrings
    }

    required init(value: Column, lossyIntegers: Bool, lossyStrings: Bool) throws {
        self.either = .value(value)
        self.lossyIntegers = lossyIntegers
        self.lossyStrings = lossyStrings
    }

    required init(unkeyed: NSNull, lossyIntegers: Bool, lossyStrings: Bool) throws {
        throw DecodingError.unimplemented
    }

    required init(any: Column, lossyIntegers: Bool, lossyStrings: Bool) throws {
        self.either = .value(any)
        self.lossyIntegers = lossyIntegers
        self.lossyStrings = lossyStrings
    }

    func integers(for value: Column) throws -> Integers? {
        switch value {
        case .uint64(let num): return .uint64(num)

        }
    }
    
    /// Columns contain values
    typealias Value = Column
    
    /// Rows are keyed sets
    typealias Keyed = Row
    
    /// Unkeyed (arrays) aren't supported
    typealias Unkeyed = NSNull
    
    /// The currently decoding keypath
    public var codingPath: [CodingKey] = []
    
    /// Unused, but required by protocol
    public var userInfo: [CodingUserInfoKey : Any] = [:]
    
    /// Creates a new RowContainer at a path
    public func container<Key>(keyedBy type: Key.Type) throws -> KeyedDecodingContainer<Key> where Key : CodingKey {
        let container = RowContainer<Key>(decoder: self)
        return KeyedDecodingContainer(container)
    }
    
    /// Creates a new unkeyed container, will always throw since it's currently unsupported
    public func unkeyedContainer() throws -> UnkeyedDecodingContainer {
        throw DecodingError.unimplemented
    }
    
    /// Creates a new single value column container
    public func singleValueContainer() throws -> SingleValueDecodingContainer {
        return ColumnContainer(decoder: self)
    }
}

extension Row : KeyedDecodingHelper {
    /// Makes Row conform to KeyedDecodingHelper to help decoding
    func value(forKey key: String) throws -> Column? {
        return self.fields.first { pair in
            return pair.field.name == key
