chore: stabilize lint and verify builds
This commit is contained in:
@@ -22,9 +22,10 @@ func Truncate(ctx context.Context, db *sql.DB, tableName ...string) error {
|
||||
for _, name := range tableName {
|
||||
sql := fmt.Sprintf("TRUNCATE TABLE %s RESTART IDENTITY", name)
|
||||
if _, err := db.ExecContext(ctx, sql); err != nil {
|
||||
return err
|
||||
return fmt.Errorf("truncate table %s: %w", name, err)
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -41,10 +42,15 @@ func WrapLikeRight(v string) string {
|
||||
}
|
||||
|
||||
func Provide(...opt.Option) error {
|
||||
return container.Container.Provide(func(db *gorm.DB) contracts.Initial {
|
||||
if err := container.Container.Provide(func(db *gorm.DB) contracts.Initial {
|
||||
models.SetDefault(db)
|
||||
|
||||
return models.Q
|
||||
}, atom.GroupInitial)
|
||||
}, atom.GroupInitial); err != nil {
|
||||
return fmt.Errorf("provide database initial: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func DefaultProvider() container.ProviderContainer {
|
||||
|
||||
Reference in New Issue
Block a user