WebhookDB Gives You Wings!
Rob Galanakis on June 1, 2023
Pick an API you enjoy using. Let's say Stripe, since it's a pretty darn good and common API.
Choose a question to ask your Stripe data. Let's start with something simple, like, 'how many charges were refunded over the last 30 days?'.
Now, I'll answer this question using the API. You go ahead and answer it using WebhookDB:
$ psql `webhookdb db connection` > SELECT SUM(amount) as total FROM stripe_refund_v1 WHERE created >= (NOW() - '30 days'::interval) AND created < NOW() AND status = 'succeeded';
Darn, you beat me! By a lot.
Let's try again. Let's find any Customers in Stripe that don't have a User in our application database.
I'll try using the API. Since you're self-hosting WebhookDB, you can query Stripe and your application database in the same query:
> SELECT stripe_id, data->'metadata'->>'user_id' FROM webhookdb.stripe_customer_v1 WHERE (data->'metadata'->>'user_id')::BIGINT NOT IN (SELECT id FROM myapp_users)
Uh, ok, you beat me again. Wasn't even close.
This speed and flexibility is why we say WebhookDB gives you wings.
If you're ready to stop stumbling around, then learn how to fly with WebhookDB.