func (f *File) Unwrap() *File {
	tx, ok := f.config.driver.(*txDriver)
	if !ok {
		panic("ent: File is not a transactional entity")
	}
	f.config.driver = tx.drv
	return f
}
Unwrap unwraps the File entity that was returned from a transaction after it was closed,
so that all future queries will be executed through the driver which created the transaction.
package ent
import (
	"fmt"
	"strings"
	"entgo.io/contrib/entproto/cmd/protoc-gen-ent/internal/todo/ent/file"
	"entgo.io/ent/dialect/sql"
)
type File struct {
	config `json:"-"`
	ID string `json:"id,omitempty"`
	Contents string `json:"contents,omitempty"`
}
func (*File) scanValues(columns []string) ([]interface{}, error) {
	values := make([]interface{}, len(columns))
	for i := range columns {
		switch columns[i] {
		case file.FieldID, file.FieldContents:
			values[i] = new(sql.NullString)
		default:
			return nil, fmt.Errorf("unexpected column %q for type File", columns[i])
		}
	}
	return values, nil
}
func (f *File) assignValues(columns []string, values []interface{}) error {
	if m, n := len(values), len(columns); m < n {
		return fmt.Errorf("mismatch number of scan values: %d != %d", m, n)
	}
	for i := range columns {
		switch columns[i] {
		case file.FieldID:
			if value, ok := values[i].(*sql.NullString); !ok {
				return fmt.Errorf("unexpected type %T for field id", values[i])
			} else if value.Valid {
				f.ID = value.String
			}
		case file.FieldContents:
			if value, ok := values[i].(*sql.NullString); !ok {
				return fmt.Errorf("unexpected type %T for field contents", values[i])
			} else if value.Valid {
				f.Contents = value.String
			}
		}
	}
	return nil
}
func (f *File) Update() *FileUpdateOne {
	return (&FileClient{config: f.config}).UpdateOne(f)
}