func (o LabelSlice) DeleteAll(ctx context.Context, exec boil.ContextExecutor) (int64, error) {
	if o == nil {
		return 0, errors.New("models: no Label slice provided for delete all")
	}

	if len(o) == 0 {
		return 0, nil
	}

	if len(labelBeforeDeleteHooks) != 0 {
		for _, obj := range o {
			if err := obj.doBeforeDeleteHooks(ctx, exec); err != nil {
				return 0, err
			}
		}
	}

	var args []interface{}
	for _, obj := range o {
		pkeyArgs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(obj)), labelPrimaryKeyMapping)
		args = append(args, pkeyArgs...)
	}

	sql := "DELETE FROM \"labels\" WHERE " +
		strmangle.WhereClauseRepeated(string(dialect.LQ), string(dialect.RQ), 1, labelPrimaryKeyColumns, len(o))

	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 all from label slice")
	}

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

	if len(labelAfterDeleteHooks) != 0 {
		for _, obj := range o {
			if err := obj.doAfterDeleteHooks(ctx, exec); err != nil {
				return 0, err
			}
		}
	}

	return rowsAff, nil
}
// DeleteAll deletes all rows in the slice, using an executor.
DeleteAll deletes all rows in the slice, using an executor.
// DeleteAll deletes all rows in the slice using an executor .
func (o LabelSlice) DeleteAll(ctx context.Context, exec boil.ContextExecutor) (int64, error) {
	if o == nil {
		return 0, errors.New("models: no Label slice provided for delete all")
	}
	if len(o) == 0 {
		return 0, nil
	}
	if len(labelBeforeDeleteHooks) != 0 {
		for _, obj := range o {
			if err := obj.doBeforeDeleteHooks(ctx, exec); err != nil {
				return 0, err
			}
		}
	}
	var args []interface{}
	for _, obj := range o {
		pkeyArgs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(obj)), labelPrimaryKeyMapping)
		args = append(args, pkeyArgs...)
	}
	sql := "DELETE FROM \"labels\" WHERE " +
		strmangle.WhereClauseRepeated(string(dialect.LQ), string(dialect.RQ), 1, labelPrimaryKeyColumns, len(o))
	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 all from label slice")
	}
	rowsAff, err := result.RowsAffected()
	if err != nil {
		return 0, errors.Wrap(err, "models: failed to get rows affected by deleteall for labels")
	}
	if len(labelAfterDeleteHooks) != 0 {
		for _, obj := range o {
			if err := obj.doAfterDeleteHooks(ctx, exec); err != nil {
				return 0, err
			}
		}
	}
	return rowsAff, nil
}
func ( o LabelSlice ) DeleteAll ( ctx context . Context , exec boil . ContextExecutor ) ( int64 , error ) { if o == nil { return 0 , errors . New ( " " ) } if len ( o ) == 0 { return 0 , nil } if len ( labelBeforeDeleteHooks ) != 0 { for _ , obj := range o { if err := obj . doBeforeDeleteHooks ( ctx , exec ) ; err != nil { return 0 , err } } } var args [ ] interface { } for _ , obj := range o { pkeyArgs := queries . ValuesFromMapping ( reflect . Indirect ( reflect . ValueOf ( obj ) ) , labelPrimaryKeyMapping ) args = append ( args , pkeyArgs ... ) } sql := " \" \" " + strmangle . WhereClauseRepeated ( string ( dialect . LQ ) , string ( dialect . RQ ) , 1 , labelPrimaryKeyColumns , len ( o ) ) 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 len ( labelAfterDeleteHooks ) != 0 { for _ , obj := range o { if err := obj . doAfterDeleteHooks ( ctx , exec ) ; err != nil { return 0 , err } } } return rowsAff , nil }
DeleteAll deletes all rows in the slice, using an executor.
DeleteAll deletes all rows in the slice using an executor .