I'm written a software as an exercise to improve my skills and I ask my self about how to test code that changes a database.
Let the code in my github: https://github.com/daniloanp/Ensaios/blob/develop/application/backend/pgsql/tables/module.go
What is the best technique to perform tests over, for example, the Create and Update methods?
My first attempt was using the GetByID to test my insert, but considering the fact GetByID wasn't tested yeat, I don't know if that is good way to test.
Currently I'm thinking about use a third party ORM or library to check if the database was tested as expected. I could test even the GetByID comparing the results of my own implementation and the thirdy party ones.
Are there any good material about it? Any recomendation or good framework in Golang or even in any other language?
Update: Well, I think I need something like Java DbUNit in Go