Last active
June 25, 2020 03:58
-
-
Save pjebs/c7cd6f87674fccdcfbc4eb674fc68542 to your computer and use it in GitHub Desktop.
sqlx benchmark
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i := 0; i < b.N; i++ { | |
db := sqlx.NewDb(db, "mysql") | |
q := fmt.Sprintf("SELECT id, name, email FROM tests ORDER BY id LIMIT %d", lim) | |
res := []model{} | |
err := db.Select(&res, q) | |
if err != nil { | |
b.Fatal(err) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment