Add methods for loading package flags through the database iterator
Reset the database iterator first when return the number of packages from __len__()