def duplicate(self, new_name: str) -> "Table":
        """
        Create a duplicate of this table, copying across the schema and all row data.

        :param new_name: Name of the new table
        """
        if not self.exists():
            raise NoTable(f"Table {self.name} does not exist")
        with self.db.conn:
            sql = "CREATE TABLE [{new_table}] AS SELECT * FROM [{table}];".format(
                new_table=new_name,
                table=self.name,
            )
            self.db.execute(sql)
        return self.db[new_name]

        Create a duplicate of this table, copying across the schema and all row data.

        :param new_name: Name of the new table
        
sqlite_utils/db.py