diff --git a/README.md b/README.md index 78e6e8f0f7..59ca09174a 100644 --- a/README.md +++ b/README.md @@ -438,6 +438,53 @@ sponsor](https://github.com/sponsors/kyleconroy) today. Sponsors receive priority support via the sqlc Slack organization. +## Development + +### Building + +For local development, install `sqlc` under an alias. We suggest `sqlc-dev`. + +``` +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. + +``` +go test --tags=exp ./... +``` + +To run the tests in the examples folder, a running PostgreSQL instance is +required. The tests use the following environment variables to connect to the +database: + +``` +Variable Default Value +------------------------- +PG_HOST 127.0.0.1 +PG_PORT 5432 +PG_USER postgres +PG_PASSWORD mysecretpassword +PG_DATABASE dinotest +``` + +``` +go test --tags=examples,exp ./... +``` + +### Regenerate exepected test output + +If you need to update a large number of expexted test output in the +`internal/endtoend/testdata` directory, run the `regenerate.sh` script. + +``` +cd internal/endtoend +./regenerate.sh +``` + ## Acknowledgements sqlc was inspired by [PugSQL](https://pugsql.org/) and