https://github.com/wayjam/go-sql-benchmark
https://github.com/wayjam/go-sql-benchmark
benchmark go golang sql
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/wayjam/go-sql-benchmark
- Owner: wayjam
- License: mit
- Created: 2020-09-13T16:33:13.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-10-06T08:28:38.000Z (over 5 years ago)
- Last Synced: 2023-03-04T21:36:54.179Z (about 3 years ago)
- Topics: benchmark, go, golang, sql
- Language: Go
- Homepage:
- Size: 19.5 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Golang SQL-libs Benchmark
## Libs to test
This benchmark will use Postgres as a test database and [pgx](https://github.com/jackc/pgx) as the driver.
- database/sql
- [sqlx](https://github.com/jmoiron/sqlx)
- [pgx](https://github.com/jackc/pgx)
- [gorm](https://github.com/go-gorm/gorm)
- [squirrel](https://github.com/Masterminds/squirrel)
## Run
**Start a PostgreSQL Image**:
```sh
docker run -d \
--name go-sql-benchmark-pg \
-p 5432:5432 \
-e POSTGRES_PASSWORD=postgres \
-e POSTGRES_DB=test \
-e POSTGRES_USERNAME=postgres \
postgres:12
```
**Start the test**
```sh
export BENCHMARK_SQL_DSN="host=localhost user=postgres password=postgres dbname=test sslmode=disable"
# run
go test -v ./... -bench=. -benchmem
```
## Report
Using [cob](https://github.com/knqyf263/cob) to run benchmark on Github Actions.
Find the reference report at:
## TODO
- [x] CI and auto-genereated report
- [ ] prepare statement benchmark
- [ ] [ent](https://github.com/facebook/ent) benchmark
- [ ] add more code comments
- [ ] comparison between libs.
## Contribute
Feel free to make contributiton to this project.
### Donate
