def save_fixtures_to_db(
        self, fixtures_pack="generic", fixtures_dict=None, use_object_ids=False
    ):
        """
        Loads fixtures specified in fixtures_dict into the database
        and returns DB models for the fixtures.

        fixtures_dict should be of the form:
        {
            'actions': ['action-1.yaml', 'action-2.yaml'],
            'rules': ['rule-1.yaml'],
            'liveactions': ['execution-1.yaml']
        }

        :param fixtures_pack: Name of the pack to load fixtures from.
        :type fixtures_pack: ``str``

        :param fixtures_dict: Dictionary specifying the fixtures to load for each type.
        :type fixtures_dict: ``dict``

        :param use_object_ids: Use object id primary key from fixture file (if available) when
                              storing objects in the database. By default id in
                              file is discarded / not used and a new random one
                              is generated.
        :type use_object_ids: ``bool``

        :rtype: ``dict``
        """
        if fixtures_dict is None:
            fixtures_dict = {}

        fixtures_pack_path = self._validate_fixtures_pack(fixtures_pack)
        self._validate_fixture_dict(fixtures_dict, allowed=ALLOWED_DB_FIXTURES)

        db_models = {}
        for fixture_type, fixtures in six.iteritems(fixtures_dict):
            API_MODEL = FIXTURE_API_MODEL.get(fixture_type, None)
            PERSISTENCE_MODEL = FIXTURE_PERSISTENCE_MODEL.get(fixture_type, None)

            loaded_fixtures = {}
            for fixture in fixtures:
                # Guard against copy and type and similar typos
                if fixture in loaded_fixtures:
                    msg = 'Fixture "%s" is specified twice, probably a typo.' % (
                        fixture
                    )
                    raise ValueError(msg)

                fixture_dict = self.meta_loader.load(
                    self._get_fixture_file_path_abs(
                        fixtures_pack_path, fixture_type, fixture
                    )
                )
                api_model = API_MODEL(**fixture_dict)
                db_model = API_MODEL.to_model(api_model)

                # Make sure we also set and use object id if that functionality is used
                if use_object_ids and "id" in fixture_dict:
                    db_model.id = fixture_dict["id"]

                db_model = PERSISTENCE_MODEL.add_or_update(db_model)
                loaded_fixtures[fixture] = db_model

            db_models[fixture_type] = loaded_fixtures

        return db_models

        Loads fixtures specified in fixtures_dict into the database
        and returns DB models for the fixtures.

        fixtures_dict should be of the form:
        {
            'actions': ['action-1.yaml', 'action-2.yaml'],
            'rules': ['rule-1.yaml'],
            'liveactions': ['execution-1.yaml']
        }

        :param fixtures_pack: Name of the pack to load fixtures from.
        :type fixtures_pack: ``str``

        :param fixtures_dict: Dictionary specifying the fixtures to load for each type.
        :type fixtures_dict: ``dict``

        :param use_object_ids: Use object id primary key from fixture file (if available) when
                              storing objects in the database. By default id in
                              file is discarded / not used and a new random one
                              is generated.
        :type use_object_ids: ``bool``

        :rtype: ``dict``
        
st2tests/st2tests/fixturesloader.py