HUB
Sign inSign up

ftpsolutions/hasura-postgres-schema-sync

By ftpsolutions

•Updated over 4 years ago

A service to keep a Hasura instance in sync with a Postgres database

Image
0

100K+

ftpsolutions/hasura-postgres-schema-sync repository overview

⁠hasura-postgres-schema-sync

A service to keep a Hasura instance in sync with a Postgres database.

Source is at https://github.com/ftpsolutions/hasura-postgres-schema-sync⁠.

⁠Concept

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.

⁠Usage

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.

Tag summary
Recent tags
Content type
Image
Digest
sha256:f90aadea3…
Size
178.9 MB
Last updated
over 4 years ago
docker pull ftpsolutions/hasura-postgres-schema-sync:latest