func (o *Honor) Delete(ctx context.Context, exec boil.ContextExecutor) (int64, error) {
	if o == nil {
		return 0, errors.New("models: no Honor provided for delete")
	}

	if err := o.doBeforeDeleteHooks(ctx, exec); err != nil {
		return 0, err
	}

	args := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(o)), honorPrimaryKeyMapping)
	sql := "DELETE FROM \"honors\" WHERE \"honor_id\"=$1"

	if boil.DebugMode {
		fmt.Fprintln(boil.DebugWriter, sql)
		fmt.Fprintln(boil.DebugWriter, args...)
	}

	result, err := exec.ExecContext(ctx, sql, args...)
	if err != nil {
		return 0, errors.Wrap(err, "models: unable to delete from honors")
	}

	rowsAff, err := result.RowsAffected()
	if err != nil {
		return 0, errors.Wrap(err, "models: failed to get rows affected by delete for honors")
	}

	if err := o.doAfterDeleteHooks(ctx, exec); err != nil {
		return 0, err
	}

	return rowsAff, nil
}
// Delete deletes a single Honor record with an executor.
// Delete will match against the primary key column to find the record to delete.
Delete deletes a single Honor record with an executor.
Delete will match against the primary key column to find the record to delete.
// Delete deletes a single Honor record with an executor . // Delete will match against the primary key column to find the record to delete .
func (o *Honor) Delete(ctx context.Context, exec boil.ContextExecutor) (int64, error) {
	if o == nil {
		return 0, errors.New("models: no Honor provided for delete")
	}
	if err := o.doBeforeDeleteHooks(ctx, exec); err != nil {
		return 0, err
	}
	args := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(o)), honorPrimaryKeyMapping)
	sql := "DELETE FROM \"honors\" WHERE \"honor_id\"=$1"
	if boil.DebugMode {
		fmt.Fprintln(boil.DebugWriter, sql)
		fmt.Fprintln(boil.DebugWriter, args...)
	}
	result, err := exec.ExecContext(ctx, sql, args...)
	if err != nil {
		return 0, errors.Wrap(err, "models: unable to delete from honors")
	}
	rowsAff, err := result.RowsAffected()
	if err != nil {
		return 0, errors.Wrap(err, "models: failed to get rows affected by delete for honors")
	}
	if err := o.doAfterDeleteHooks(ctx, exec); err != nil {
		return 0, err
	}
	return rowsAff, nil
}
func ( o * Honor ) Delete ( ctx context . Context , exec boil . ContextExecutor ) ( int64 , error ) { if o == nil { return 0 , errors . New ( " " ) } if err := o . doBeforeDeleteHooks ( ctx , exec ) ; err != nil { return 0 , err } args := queries . ValuesFromMapping ( reflect . Indirect ( reflect . ValueOf ( o ) ) , honorPrimaryKeyMapping ) sql := " \" \" \" \" " if boil . DebugMode { fmt . Fprintln ( boil . DebugWriter , sql ) fmt . Fprintln ( boil . DebugWriter , args ... ) } result , err := exec . ExecContext ( ctx , sql , args ... ) if err != nil { return 0 , errors . Wrap ( err , " " ) } rowsAff , err := result . RowsAffected ( ) if err != nil { return 0 , errors . Wrap ( err , " " ) } if err := o . doAfterDeleteHooks ( ctx , exec ) ; err != nil { return 0 , err } return rowsAff , nil }
Delete deletes a single Honor record with an executor.
Delete deletes a single Honor record with an executor .