A service to keep a Hasura instance in sync with a Postgres database
100K+
A service to keep a Hasura instance in sync with a Postgres database.
Source is at https://github.com/ftpsolutions/hasura-postgres-schema-sync.
You already have a Postgres instance and a Hasura instance and you want something to do the hard work of keeping Hasura aware of your changing database schema.
Enter hasura-postgres-schema-sync, a small Python service that regularly walks the schema of the given Postgres database, converts it to
Hasura metadata and updates Hasura with it.
Use docker run to run a temporary container pointed at your Postgres database and Hasura instance:
docker run --rm -it \
-e POSTGRES_SCHEMA=public \
-e POSTGRES_HOST=your-postgres-database.org.au \
-e POSTGRES_PORT=5432 \
-e POSTGRES_USER=postgres \
-e POSTGRES_PASSWORD=Password1 \
-e POSTGRES_DB=some_database \
-e HASURA_HOST=your-hasura-instance.org.au \
-e HASURA_PORT=8080 \
-e HASURA_USER=admin \
-e HASURA_PASSWORD=Password1 \
ftpsolutions/hasura-postgres-schema-sync:latest
This will leave you with an attached container, attempting to sync your Postgres database with your Hasura instance on a 10 second schedule.
docker pull ftpsolutions/hasura-postgres-schema-sync:latest