4 ms·
Does an update of 100 rows result in 100 webhook calls or 1 webhook with a payload of 100 rows?
by crescentfresh 8y ago
Does an update of 100 rows result in 100 webhook calls or 1 webhook with a payload of 100 rows?
- vsurabhi 8y ago100 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.
- anarazel 8y ago> 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.
- vsurabhi 8y agoThat'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 https://github.com/hasura/skor/issues/8).