             let sql = "SELECT * FROM \(tableName.quotedDatabaseIdentifier) WHERE \(conditionSQL)"
             return db.selectStatement(sql)
         }
-    }
-
-    private enum DataMapperError : ErrorType {
-        case RowNotFound
     }
 }
 

    - throws: A DatabaseError whenever a SQLite error occurs.
    */
    public func insert(db: Database) throws {
        try withDataMapper { dataMapper -> Void in
            let changes = try dataMapper.insert(db)
            
            // Update RowID column if needed
            if let primaryKey = self.dynamicType.databaseTable?.primaryKey, case .RowID(let rowIDColumn) = primaryKey {
                guard let rowID = dataMapper.storedDatabaseDictionary[rowIDColumn] else {
                    fatalError("\(self.dynamicType).storedDatabaseDictionary must return the value for the primary key `(rowIDColumn)`")
                }
                if rowID == nil {
                    setDatabaseValue(DatabaseValue.Integer(changes.insertedRowID!), forColumn: rowIDColumn)
                }
            }
            
            edited = false
        }
    }
    
    /**

              updated.
    */
    public func update(db: Database) throws {
        let changes = try DataMapper(self).update(db)
        
        // if no row was updated, we have a problem.
        guard changes.changedRowCount > 0 else {
            throw RowModelError.RowModelNotFound(self)
        }
        
        edited = false
    }
    
    /**
