Hacker News new | ask | show | jobs
by crescentfresh 2969 days ago
Does an update of 100 rows result in 100 webhook calls or 1 webhook with a payload of 100 rows?
1 comments

100 webhook calls as the trigger is executed whenever a row is modified.

Postgres's per statement triggers don't let you capture the rows that are modified and skor doesn't do any sort of batching currently.

> Postgres's per statement triggers don't let you capture the rows that are modified

They do these days. Since 10 you can specify:

  REFERENCING { { OLD | NEW } TABLE [ AS ] transition_relation_name } [ ... ] ]
in a FOR EACH STATEMENT ... AFTER trigger.
That's great news ! So the trigger can use json_agg to compose the notification with all the modified rows. We'll document it (https://github.com/hasura/skor/issues/8).