Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

叩かれているSQLを表示する実装 #262

Open
ryuseifujisaki opened this issue Nov 22, 2022 · 0 comments
Open

叩かれているSQLを表示する実装 #262

ryuseifujisaki opened this issue Nov 22, 2022 · 0 comments

Comments

@ryuseifujisaki
Copy link
Collaborator

ryuseifujisaki commented Nov 22, 2022

db.Debug().Where~
を全SQLに対して実装する
例)go_api/infrastructure/winner.go

// 全ウィナーの取得
func (w *WinnerInfrastructure) FindAll() (*domain.Winners, error) {
	winners := domain.Winners{}
	if err := w.db.Find(&winners).Error; err != nil {
		return nil, err
	}
	w.db.Debug().Find(&winners)
	return &winners, nil
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant