code: def _ReadAndCheckStorageMetadata(self, check_readable_only=False):
      
      query = 'SELECT key, value FROM metadata'
      self._cursor.execute(query)
  
      metadata_values = {row[0]: row[1] for row in self._cursor.fetchall()}
  
      self._CheckStorageMetadata(
          metadata_values, check_readable_only=check_readable_only)
  
      self.format_version = metadata_values['format_version']
      self.compression_format = metadata_values['compression_format']
      self.serialization_format = metadata_values['serialization_format']
      self.storage_type = metadata_values['storage_type']
docs: Reads storage metadata and checks that the values are valid.
  
      Args:
        check_readable_only (Optional[bool]): whether the store should only be
            checked to see if it can be read. If False, the store will be checked
            to see if it can be read and written to.