Check if database was already initialized in set_meta_data and set_static_data
If set_meta_data
or set_static_data
are called before the database instance was created, self.db
is None and they will not work but don't provide a helpful error message.
Thus, it should be checked if self.db is None
and a meaningful error messages shown in that case.