From 28b84fdcf9241d64690a4ed15ea1a8aa4fb08af6 Mon Sep 17 00:00:00 2001 From: Kevin Burke Date: Thu, 9 Apr 2020 12:35:45 -0700 Subject: [PATCH] Makefile: update target Add sqlc-dev as a dependency of the "regen" target to lower the possibility that someone is running regenerate with an out of date sqlc binary. Also update the docs to refer to the Make target instead of the script. --- Makefile | 2 +- README.md | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 1e4cef6a5e..f99b49c83b 100644 --- a/Makefile +++ b/Makefile @@ -7,5 +7,5 @@ test: sqlc-dev: go build -o ~/bin/sqlc-dev --tags=exp ./cmd/sqlc/ -regen: +regen: sqlc-dev ./scripts/regenerate.sh diff --git a/README.md b/README.md index 4daaaebf6d..4653b6a704 100644 --- a/README.md +++ b/README.md @@ -350,7 +350,7 @@ scopes the override behavior to just a single package: ```yaml version: "1" -packages: +packages: - overrides: [...] ``` @@ -464,7 +464,7 @@ go build -o ~/go/bin/sqlc-dev ./cmd/sqlc ### Running Tests To run the tests, include the `exp` tag. Without this tag, a few tests will -fail. +fail. ``` go test --tags=exp ./... @@ -494,9 +494,12 @@ If you need to update a large number of expected test output in the `internal/endtoend/testdata` directory, run the `regenerate.sh` script. ``` -./scripts/regenerate.sh +make regen ``` +Note that this uses the `sqlc-dev` binary, not `sqlc` so make sure you have an +up to date `sqlc-dev` binary. + ## Acknowledgements sqlc was inspired by [PugSQL](https://pugsql.org/) and