0

I have an incremental model set up in DBT CORE. I already know to distinguish new and old records in a query.

Now I would like to use DBT post_hook to send REST request (POST) with those ids to an endpoint (my backend), i.e.

{{ config(materialized="incremental", .., post_hook=" {{ send_to_endpoint(ids) }} ") }}

where send_to_endpoint(ids) is a dbt macro. And after many hours of struggle I still haven't figured out how to do that and now even doubt that it is even possible. Can anybody help? :)

Krzysztof
  • 5
  • 1
  • 1
    You'll need to share much more stuff if you want people to help you: macro code, error(s) you are getting, etc – Aleix CC Aug 07 '23 at 09:44
  • AleixCC is correct. But to get you on the right track, this isn't something DBT supports directly. You will need to implement this as a Postgres function and then call it through a DBT post-hook. Look at this to get your started: https://stackoverflow.com/questions/46540352/calling-restful-web-services-from-postgresql-procedure-function – Adam Kipnis Aug 07 '23 at 15:17

0 Answers0