Hacker News new | ask | show | jobs
by dugmartin 4884 days ago
Reading the headline I thought they were introducing a SQL like interface to their API, sort of like FQL for Facebook and I got a little excited. Something like this to get the email addresses of all your active trial subscribers:

SELECT c.email FROM customers c, subscriptions s WHERE c.subscription_id = s.id AND s.status = "active" and s.trial_start IS NOT NULL;

(where of course the customer and subscription tables would be a virtual view on your customers and subscriptions)

2 comments

Hm, that could be pretty cool actually. Especially if we also added a REPL for interactive queries at manage.stripe.com.
You're welcome Patrick. I'd recommend looking at Antlr4 to parse the "StripeSQL" commands.
Thanks for the Antlr reference; I've been meaning to learn more about it and you've pushed me to finally start!
Isn't there a postgres foreign data wrapper than lets you do this?