Repository navigation
fix(warehouse): stop offering one database as two sources - #1300
Merged
Merged
Conversation
A project on Neon or Supabase still names its connection with the generic Postgres signals (`DATABASE_URL`, a `pg` driver), so detection returned both the hosted kind and `Postgres`. Every consumer treats a detected kind as a source to create, and the seeded step is asked to reach an outcome for each one — so the same tables were imported twice. `SourceDetector.supersededBy` names the kinds that reach the same data through a more specific connector, and the detection loop drops an entry when one of them also matched. Postgres declares Neon and Supabase; nothing else changes. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Generated-By: PostHog Desktop Task-Id: 03c0f29b-d484-443b-abe3-aa2c93052391
🧙 Wizard CIRun the Wizard CI and test your changes against wizard-workbench example apps by replying with a GitHub comment using one of the following commands: Test all apps:
Test all apps in a directory:
Test an individual app:
Show more apps
Test against a Context Mill branch:
Add Results will be posted here when complete. |
edwinyjlim
approved these changes
Sep 24, 2026
edwinyjlim
left a comment
Member
There was a problem hiding this comment.
robot says there might be some edge cases where Supabase matches on any SUPABASE_* key or supabase-js that are only used for auth/storage, but the product DB is a separate Postgres (e.g. Prisma + pg on RDS)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Detection returns one entry per matched registry kind, and a hosted Postgres
provider does not replace the generic Postgres footprint: a Neon or Supabase
project still names its connection with
DATABASE_URLor apg-familydriver, so both the hosted kind and
Postgrescome back.Nothing downstream treats that as one database. The standalone
warehousecommand's prompt lists every detected kind as a source to set up, and the
seeded data-source step is handed the same list and asked to reach an outcome
for each kind. A run that answers both ends with two warehouse sources over
one database, importing the same tables twice — the user pays ingestion for
the duplicate and gets two copies of every table.
Why: this came out of reading the seeded data-source step's telemetry,
where a run reported connecting the same database under two kinds.
Changes
SourceDetector.supersededBynames the kinds that reach the same datathrough a more specific connector.
detectWarehouseSourcesdrops an entry when one of its supersessors alsomatched, so the more specific kind is the one offered.
Postgresdeclares Neon and Supabase. No other entry sets the field, andthe signals themselves are untouched — a project with no hosted provider
still gets
Postgresexactly as before.Test plan
detect.test.ts: a Neon project and a Supabase project each offer only thehosted kind, a plain Postgres project is unchanged, and a registry check
holds
supersededByto kinds that exist. The previous test asserting thedouble detection is replaced by these.
tsc --noEmitclean; Prettier and ESLint clean on the touched files.Created with PostHog Desktop
🤖 Generated with Claude Code