1
0
mirror of https://github.com/zhashkevych/go-sqlxmock.git synced 2025-06-24 21:56:48 +02:00

Merge pull request #164 from theodesp/examples/go-sql-driver-imports

Examples/go sql driver imports
This commit is contained in:
Gediminas Morkevicius
2019-03-01 16:57:32 +02:00
committed by GitHub

View File

@ -37,12 +37,16 @@ See implementation examples:
- [blog API server](https://github.com/DATA-DOG/go-sqlmock/tree/master/examples/blog)
- [the same orders example](https://github.com/DATA-DOG/go-sqlmock/tree/master/examples/orders)
### Something you may want to test
### Something you may want to test, assuming you use the [go-mysql-driver](https://github.com/go-sql-driver/mysql)
``` go
package main
import "database/sql"
import (
"database/sql"
_ "github.com/go-sql-driver/mysql"
)
func recordStats(db *sql.DB, userID, productID int64) (err error) {
tx, err := db.Begin()