-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add SQLite support and document testing
This change also adds a docker-compose’d set of databases against which to test any changes to the codebase. In particular it provides both a Postgres and a MySQL instance against which database specific changes can be tested. They are very insecurely configured at boot - caveat emptor.
- Loading branch information
Showing
7 changed files
with
72 additions
and
4 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
POSTGRESQL_DATASOURCE ?= postgresql://sqalx:sqalx@localhost:5432/sqalx?sslmode=disable | ||
MYSQL_DATASOURCE ?= sqalx:sqalx@tcp(localhost:3306)/sqalx | ||
SQLITE_DATASOURCE ?= :memory: | ||
|
||
.PHONY: test | ||
|
||
test: | ||
POSTGRESQL_DATASOURCE="$(POSTGRESQL_DATASOURCE)" \ | ||
MYSQL_DATASOURCE="$(MYSQL_DATASOURCE)" \ | ||
SQLITE_DATASOURCE="$(SQLITE_DATASOURCE)" \ | ||
go test -v -cover -race -timeout=1m ./... && echo OK || (echo FAIL && exit 1) |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
version: '3.6' | ||
|
||
services: | ||
postgres: | ||
image: postgres:9.6-alpine | ||
ports: | ||
- 5432:5432 | ||
environment: | ||
- POSTGRES_USER=sqalx | ||
- POSTGRES_PASSWORD=sqalx | ||
|
||
mysql: | ||
image: mysql:8.0 # intel only | ||
# image: mysql/mysql-server:8.0 # mac M1 preview | ||
ports: | ||
- 3306:3306 | ||
environment: | ||
- MYSQL_ROOT_PASSWORD=sqalx | ||
- MYSQL_USER=sqalx | ||
- MYSQL_PASSWORD=sqalx | ||
- MYSQL_DATABASE=sqalx |
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
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
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
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