feat(pgpm): uniform --emit-sql/--emit-bundle projections on transform and import - #1580
Merged
Conversation
… and import The composable SQL/bundle projections previously only landed on pgpm diff. Wire the same shared projection helpers into pgpm transform and pgpm import so one run can emit a module plus linear SQL and/or a content-addressed bundle. - shared parseEmitProjectionTargets/hasEmitProjection/projectModule helpers in module-projections.ts keep flag parsing identical across commands - single-package guard: --emit-sql/--emit-bundle require one output package (rejected for multi-module workspace transforms and --partition fan-out) - stdout SQL (--emit-sql -) suppresses human-readable logs so the stream stays valid SQL - e2e: compose module + linear SQL + bundle from one transform run and one import run
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 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
The composable SQL/bundle projections (added for
pgpm diffin #1576) only lived onpgpm diff. This wires the same shared helpers intopgpm transformandpgpm import, so every dials command has identical--emit-*flags: the module is the canonical artifact, and linear SQL / bundle are pure projections of it (samepackageModule/buildExecutableBundlemachinery, no new semantic path).New flags on both commands:
--emit-sql <file|->— consolidated linear SQL (-= stdout)--emit-bundle <file>— content-addressed.bundle.tar.gzShared plumbing factored into
utils/module-projections.tsso flag parsing stays byte-identical acrossdiff/transform/import:Command flow (both commands): write the module dir as before, then, when a projection is requested, run
projectModule(writtenDir, emit, ...).Guards (these projections are single-module by nature):
--partitionfans out into >1 package--dry-run--emit-sql -suppresses the human-readablelog.*lines so stdout stays valid SQLTests
transform-e2eandimport-e2eeach gain a "compose module + linear SQL + bundle from one run" case (asserts the modulepgpm.planexists, the linear SQL contains the expectedCREATE SCHEMA/CREATE TABLEin plan order, and the bundle archive reads back with changes). Full local run: transform-e2e + import-e2e 16/16, diff-e2e 8/8.Roadmap: finishes the "uniform projections across all commands" follow-up from #1340 (Parts A–C);
pgpm diffalready had these flags via #1576.Link to Devin session: https://app.devin.ai/sessions/798445577ac8487abf80e28f9ff7a916
Requested by: @pyramation