func (aauo *APIAuditUpdateOne) Save(ctx context.Context) (*APIAudit, error) {
	var (
		err  error
		node *APIAudit
	)
	aauo.defaults()
	if len(aauo.hooks) == 0 {
		node, err = aauo.sqlSave(ctx)
	} else {
		var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) {
			mutation, ok := m.(*APIAuditMutation)
			if !ok {
				return nil, fmt.Errorf("unexpected mutation type %T", m)
			}
			aauo.mutation = mutation
			node, err = aauo.sqlSave(ctx)
			mutation.done = true
			return node, err
		})
		for i := len(aauo.hooks) - 1; i >= 0; i-- {
			mut = aauo.hooks[i](mut)
		}
		if _, err := mut.Mutate(ctx, aauo.mutation); err != nil {
			return nil, err
		}
	}
	return node, err
}
// Save executes the query and returns the updated APIAudit entity.
Save executes the query and returns the updated APIAudit entity.
// Save executes the query and returns the updated APIAudit entity .
func (aauo *APIAuditUpdateOne) Save(ctx context.Context) (*APIAudit, error) {
	var (
		err  error
		node *APIAudit
	)
	aauo.defaults()
	if len(aauo.hooks) == 0 {
		node, err = aauo.sqlSave(ctx)
	} else {
		var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) {
			mutation, ok := m.(*APIAuditMutation)
			if !ok {
				return nil, fmt.Errorf("unexpected mutation type %T", m)
			}
			aauo.mutation = mutation
			node, err = aauo.sqlSave(ctx)
			mutation.done = true
			return node, err
		})
		for i := len(aauo.hooks) - 1; i >= 0; i-- {
			mut = aauo.hooks[i](mut)
		}
		if _, err := mut.Mutate(ctx, aauo.mutation); err != nil {
			return nil, err
		}
	}
	return node, err
}
func ( aauo * APIAuditUpdateOne ) Save ( ctx context . Context ) ( * APIAudit , error ) { var ( err error node * APIAudit ) aauo . defaults ( ) if len ( aauo . hooks ) == 0 { node , err = aauo . sqlSave ( ctx ) } else { var mut Mutator = MutateFunc ( func ( ctx context . Context , m Mutation ) ( Value , error ) { mutation , ok := m . ( * APIAuditMutation ) if ! ok { return nil , fmt . Errorf ( " " , m ) } aauo . mutation = mutation node , err = aauo . sqlSave ( ctx ) mutation . done = true return node , err } ) for i := len ( aauo . hooks ) - 1 ; i >= 0 ; i -- { mut = aauo . hooks [ i ] ( mut ) } if _ , err := mut . Mutate ( ctx , aauo . mutation ) ; err != nil { return nil , err } } return node , err }
Save executes the query and returns the updated APIAudit entity.
Save executes the query and returns the updated APIAudit entity .