async def store_file(
        self,
        document_id: UUID,
        file_name: str,
        file_content: io.BytesIO,
        file_type: Optional[str] = None,
    ) -> None:
        """Store a new file in the database."""
        size = file_content.getbuffer().nbytes

        async with (
            self.connection_manager.pool.get_connection() as conn  # type: ignore
        ):
            async with conn.transaction():
                oid = await conn.fetchval("SELECT lo_create(0)")
                await self._write_lobject(conn, oid, file_content)
                await self.upsert_file(
                    document_id, file_name, oid, size, file_type
                )
Store a new file in the database.
py/core/providers/file/postgres.py