Contributing
We love contributions from the community; but please: if you're planning to do something big, talk to us first. Graphile Worker is quite opinionated and prioritizes performance over many other things, so there's a risk that we may not want your feature in core, and we don't want you to waste your time!
Development
- npm
- Yarn
- pnpm
npm install
npm run watch
yarn install
yarn watch
pnpm install
pnpm run watch
In another terminal:
- npm
- Yarn
- pnpm
createdb graphile_worker_test
npm test
createdb graphile_worker_test
yarn test
createdb graphile_worker_test
pnpm test
Using Docker to develop this module
Start the dev db and app in the background
docker-compose up -d
Run the tests
docker-compose exec app yarn jest -i
Reset the test db
cat __tests__/reset-db.sql | docker-compose exec -T db psql -U postgres -v GRAPHILE_WORKER_SCHEMA=graphile_worker graphile_worker_test
Run the perf tests
docker-compose exec app node ./perfTest/run.js
monitor the container logs
docker-compose logs -f db
docker-compose logs -f app
Database migrations
New database migrations must be accompanied by an updated db dump. This can be
generated using the command yarn db:dump
, and requires a running postgres 12
server. Using docker:
docker run -e POSTGRES_HOST_AUTH_METHOD=trust -d -p 5432:5432 postgres:12
then run
- npm
- Yarn
- pnpm
PGUSER=postgres PGHOST=localhost npm run db:dump
PGUSER=postgres PGHOST=localhost yarn db:dump
PGUSER=postgres PGHOST=localhost pnpm run db:dump