Make use of Database::getFields() method instead of direct query.