Skip to content

fix(stripe_fdw): add missing status column to subscriptions table - #623

Merged
burmecia merged 2 commits into
supabase:mainfrom
sanskar-soni-9:fix/stripe-fdw-subscriptions-status-column
Aug 10, 2026
Merged

fix(stripe_fdw): add missing status column to subscriptions table#623
burmecia merged 2 commits into
supabase:mainfrom
sanskar-soni-9:fix/stripe-fdw-subscriptions-status-column

Conversation

@sanskar-soni-9

@sanskar-soni-9 sanskar-soni-9 commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce?

Bug fix.

What is the current behavior?

stripe_fdw already treats status as a pushdown qualifier for stripe.subscriptions, and docs/catalog/stripe.md recommends filtering subscriptions by id, customer, price, status — but the status column was never added to the table's column config.
As a result, where status = 'active' fails with ERROR: column "status" does not exist, even though both the code and the docs advertise it as filterable.

Closes: #317

What is the new behavior?

status text is added to the subscriptions column config and to the example in docs/catalog/stripe.md, matching the existing pattern already used for refunds.

Also the subscriptions test in tests.rs is extended to assert the new column.

Additional context

price has the same missing-column symptom (registered as a pushdown qual at stripe_fdw.rs:336, listed in the same docs note) but isn't fixable the same way — price lives nested under items.data[].price on the Stripe API object, not top-level like status, so it needs real flattening logic rather than a column-config addition. Noting it here as a follow-up, not part of this fix.

@burmecia burmecia left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

@burmecia burmecia added bug Something isn't working stripe Stripe related issues labels Aug 10, 2026
@burmecia
burmecia merged commit bf93c13 into supabase:main Aug 10, 2026
8 checks passed
@sanskar-soni-9
sanskar-soni-9 deleted the fix/stripe-fdw-subscriptions-status-column branch August 10, 2026 08:51
@sanskar-soni-9

Copy link
Copy Markdown
Contributor Author

Hi @burmecia, thanks for merging the PR!

Also as I mentioned in the PR description, price has the same problem as the status had. But its a special case as price is nested inside items array.

What do you suggest here?

  1. Support price as a simple text column (populating it with the primary/first item's price) to allow the pushdown filter?
  2. Or avoid mapping it to a single column because of multi-item subscriptions, and remove it from the pushdown options?

Let me know your thoughts!

@burmecia

Copy link
Copy Markdown
Contributor

Hi @burmecia, thanks for merging the PR!

Also as I mentioned in the PR description, price has the same problem as the status had. But its a special case as price is nested inside items array.

What do you suggest here?

  1. Support price as a simple text column (populating it with the primary/first item's price) to allow the pushdown filter?
  2. Or avoid mapping it to a single column because of multi-item subscriptions, and remove it from the pushdown options?

Let me know your thoughts!

I think option 2 is better as subscription and price is essentially 1:n relationship, the query for filtering subscription by price doesn't seem semantically correct for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working stripe Stripe related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add "status" column in subscriptions stripe to where filter "status" works outside of attrs

2 participants