Add a method to query the database during the import.