Description
I set up the Stripe wrapper then created a database view for my stripe products. I'm loading the products on getServerSideProps. It does work, until I refresh the page 4 times fast, then all data from the foreign table returns empty for an arbitrary amount of time. Are there rate limits to the Stripe Wrapper? Should I not be querying a view to a foreign Stripe table in realtime? I'm thinking I need to pull the entire thing and just use Stripe's API directly for listing products. Their API docs say they support 100 requests per second, but the wrapper can't even do 4...
create view
public.stripe_products as
select
products.id,
products.name,
products.active,
products.default_price,
products.description,
products.created,
products.updated,
products.attrs,
products.attrs -> 'metadata'::text as metadata
from
stripe.products;
Using service role server side:
const { data: products, error } = await supabaseAdmin.from('stripe_products').select('*').limit(3)
const { data: prices } = await supabaseAdmin.from('stripe_prices').select('*').order('unit_amount').limit(3)
I'm thinking of using a materialized view? But only for products listings... For customer data it needs to be realtime I think. But at that point I may as well just use getStaticProps, fetch the data from their API, and then re-deploy when I make changes to my subscription pricing.