func (wnf *WithNilFields) Unwrap() *WithNilFields {
	tx, ok := wnf.config.driver.(*txDriver)
	if !ok {
		panic("ent: WithNilFields is not a transactional entity")
	}
	wnf.config.driver = tx.drv
	return wnf
}
Unwrap unwraps the WithNilFields 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/schemast/internal/mutatetest/ent/withnilfields"
	"entgo.io/ent/dialect/sql"
)
type WithNilFields struct {
	config
	ID int `json:"id,omitempty"`
}
func (*WithNilFields) scanValues(columns []string) ([]interface{}, error) {
	values := make([]interface{}, len(columns))
	for i := range columns {
		switch columns[i] {
		case withnilfields.FieldID:
			values[i] = new(sql.NullInt64)
		default:
			return nil, fmt.Errorf("unexpected column %q for type WithNilFields", columns[i])
		}
	}
	return values, nil
}
func (wnf *WithNilFields) 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 withnilfields.FieldID:
			value, ok := values[i].(*sql.NullInt64)
			if !ok {
				return fmt.Errorf("unexpected type %T for field id", value)
			}
			wnf.ID = int(value.Int64)
		}
	}
	return nil
}
func (wnf *WithNilFields) Update() *WithNilFieldsUpdateOne {
	return (&WithNilFieldsClient{config: wnf.config}).UpdateOne(wnf)
}