feat(pgpm): default pgpm init to no extensions (opt-in via flags)#1355
Merged
Conversation
…ns/--with-extensions)
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This was referenced Jul 11, 2026
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.
Summary
pgpm initno longer forces an extensions decision. A barepgpm initnow scaffolds a module with no extensions — its.controlhas norequires =line — matching the zero-config init of comparable tools (sqitch, prisma, drizzle, dbmate, supabase, ...). Extensions become an explicit, lazy opt-in.This is PR A of the extensions-DX cleanup.
plpgsqlis always present in Postgres (requiring it was noise) anduuid-osspis legacy (gen_random_uuid()is core since PG13), so neither belongs in the default scaffold. Follow-ups: PR B hardenspgpm extensionas the canonical enable-later path (non-destructive.controlrewrite +--add/--set/--remove); PR C refreshes the tutorials.What changed
The forced checkbox in
pgpm/cli/src/commands/init/index.tswas:Now the question is only added when the user opts in, and never defaults anything:
So:
pgpm init→ no extensions (norequiresline).pgpm init --extensions uuid-ossp,citext→ non-interactive knob (unchanged extraction path; also the back-compat bridge).pgpm init --with-extensions→ interactive picker, empty default, not required.No core changes needed —
generateControlFileContentalready omitsrequires =for an empty list, and deploy already skipsCREATE EXTENSIONwhen there are none.Tests
pgpm initproduces a.controlwith norequiresline andgetRequiredModules() === [].extensionsexplicitly, so they exercise the opt-in path. Snapshots regenerated for the new test only.Note: repo-wide
pnpm lintcurrently fails on an unrelated pre-existing ESLint v9 config issue (noeslint.config.js);tsc --noEmitand the package build are clean.Link to Devin session: https://app.devin.ai/sessions/424b76f81a60499493ac946b57136ad9
Requested by: @pyramation