Now that we have set up our database in our last episode, we can now start querying the MySQL database from our Go app.
github.com/dhij/ecomm
0:00 intro
0:24 sql vs. sqlx comparison
1:52 go mod init & connect to DB
4:03 create our main.go file
5:28 create our MySQL storer file
6:11 add the Create/Get/List/Update/DeleteProduct storer methods
10:38 write unit tests with sqlmock for TestCreateProduct and TestGetProduct
20:01 add the withTestDB function to instantiate our mockDB
23:16 add failed test cases for 100% test coverage
28:25 explain unit tests for TestListProducts, TestUpdateProduct, and TestDeleteProduct
Watch video Ep2 Golang Microservice Query MySQL & sqlmock to Write Unit Tests for an E-commerce Backend online without registration, duration hours minute second in high quality. This video was added by user david hwang 24 June 2024, don't forget to share it with your friends and acquaintances, it has been viewed on our site 1,185 once and liked it 42 people.