Is it safe to open a read-only sqlite connection in a dataset?

From my understanding, a Pytorch dataset is forked by the dataloader. Does this mean the following code is safe to have in a dataset:

        self.metadata_db = sqlite3.connect(f'file:{metadata_db_path}?mode=ro', check_same_thread=False) if caption_db_path else None
        self.metadata_db_cursor = self.caption_db.cursor() if self.caption_db else None

and inside __getitem__, we do:

    def __getitem__(self, idx):
        # a bunch of stuff
        item = get_item_from_idx(idx)
        item_metadata = self.metadata_db_cursor.execute(f"select * from db where id = {}")
        item["metadata"] = item_metadata
        return item