hasura / skor

Now part of Hasura GraphQL Engine. Listen to postgres events and forward them as JSON payloads to a webhook
https://hasura.io/event-triggers
Apache License 2.0
1.25k stars 45 forks source link

Add a init script that drops and adds triggers given table names #2

Closed coco98 closed 6 years ago

coco98 commented 6 years ago

When setting up triggers for my tables I want to do something like this:

psql -U admin -d hasuradb < $(init.sh table1,table2,table3)

init.sh is a bash script that takes multiple arguments or a comma separated list of tables names and generates the DROP IF EXISTS CREATE TRIGGER kind of sql that I can pipe into psql.

This is very important as the schema evolves.