Mysqldb transformed into an object