Your Question
Hi, I wanted to know what the best strategy to write unit tests with GORM. I've read a couple different strategies that use go-sqlmock to write unit tests, however most of them are for GORM v1 and they seem to be using the gorm.open(dialect, args) which seems to have been changed. So I was wondering how I could open connections with v2. I'm still very new to Go and GORM so I would really appreciate, so the answer might have been really obvious but I wasn't able to find it after doing my research.
Thank you.
The document you expected this should be explained
Expected answer
A strategy that I can use to write unit tests with GORM (preferably using something like go-sqlmock.
Comment From: ayaanqui
I was able to find this answer on SO https://stackoverflow.com/a/71896490. I haven't tried it yet but it looks promising. Will update once I've tried it out.
Comment From: github-actions[bot]
This issue has been automatically marked as stale because it has been open 360 days with no activity. Remove stale label or comment or this will be closed in 180 days