Skip to content

Commit

Permalink
Fix: Enables translate error property of gorm (#877)
Browse files Browse the repository at this point in the history
  • Loading branch information
NeerajGartia21 authored Sep 15, 2023
1 parent d14a2b6 commit 4579408
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/server/infrastructure/datastore/mysql/mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ func New(ctx context.Context, cfg datastore.Config) (datastore.DataStore, error)
db, err := gorm.Open(mysqlgorm.Open(cfg.URL), &gorm.Config{
NamingStrategy: sqlnamer.SQLNamer{},
Logger: logger.Default.LogMode(logger.Silent),
TranslateError: true,
})
if err != nil {
return nil, err
Expand Down
1 change: 1 addition & 0 deletions pkg/server/infrastructure/datastore/postgres/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ func New(ctx context.Context, cfg datastore.Config) (datastore.DataStore, error)
NamingStrategy: sqlnamer.SQLNamer{},
DisableForeignKeyConstraintWhenMigrating: true,
Logger: logger.Default.LogMode(logger.Error),
TranslateError: true,
})

if err != nil {
Expand Down

0 comments on commit 4579408

Please sign in to comment.