Skip to main content

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 install
npm run watch

In another terminal:

createdb graphile_worker_test
npm 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

PGUSER=postgres PGHOST=localhost npm run db:dump
Three ants crawling atop the footer