feat: add @pgpmjs/migrate-client workspace package with zero codegen deps#834
Merged
pyramation merged 2 commits intomainfrom Mar 17, 2026
Merged
Conversation
…deps - Add sdk/migrate-client/ workspace package for typed Migrate API access - Move codegen generate script to sdk/constructive-sdk/scripts/ to avoid circular deps (migrate-client has no codegen devDep) - Regenerate ORM from main's fixed codegen (input-types-generator fixes) - Add @pgpmjs/migrate-client dependency to pgpm/core - migrate-client generate script runs via: pnpm --filter @constructive-io/sdk run generate:migrate-client
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:
|
4 tasks
…README to repo conventions - Remove all TrgmSimilarity computed fields and trgm search inputs from migrate.graphql - Remove searchScore, fullTextSearch, and TrgmSearchInput type from schema - Regenerate ORM from cleaned schema - tsconfig.json now extends ../../tsconfig.json (matching other SDK packages) - tsconfig.esm.json uses ESNext module + bundler moduleResolution (matching others) - README.md updated with logo, CI badge, license badge, version badge, and disclaimer
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
Adds
sdk/migrate-client/as a new workspace package (@pgpmjs/migrate-client) providing a typed GraphQL ORM client for the Constructive Migrate API (db_migrateschema).The key design decision: the codegen generation script lives in
sdk/constructive-sdk/scripts/generate-migrate-client.ts, not in migrate-client itself. This avoids circular dependencies — sincepgpm/corewill import@pgpmjs/migrate-client, having codegen as a devDep in migrate-client could create a cycle if codegen depends on anything in pgpm/core's dependency chain.Changes:
sdk/migrate-client/— new workspace package with generated ORM, schema, tsconfig, READMEsdk/constructive-sdk/scripts/generate-migrate-client.ts— codegen script that reads from../migrate-client/schemas/and outputs to../migrate-client/src/sdk/constructive-sdk/package.json— addedgenerate:migrate-clientscriptpgpm/core/package.json— added@pgpmjs/migrate-clientworkspace dependencypnpm-lock.yaml— updated (includes cosmetic reformatting by pnpm)To regenerate the ORM:
pnpm --filter @constructive-io/sdk run generate:migrate-clientUpdates since last revision
*TrgmSimilaritycomputed fields,searchScore,fullTextSearch,TrgmSearchInputtype,trgm*filter inputs, and*_TRGM_SIMILARITY_*/SEARCH_SCORE_*orderBy values frommigrate.graphql. These were artifacts from an instance with pg_trgm enabled and not relevant to the base migrate API.tsconfig.jsonnow extends../../tsconfig.json;tsconfig.esm.jsonusesESNextmodule +bundlermoduleResolution.Review & Testing Checklist for Human
depstype correctness: The generatedinput-types.tsstill typesdepsasstring | nullin some interfaces (e.g.SqlAction,SqlActionPatch), but the GraphQL schema declaresdeps: [String](an array). TheSqlActionInputinterface correctly hasdeps?: string[]. This inconsistency suggests the codegen's array-type mapping still has a gap for non-input types. Check whether this blocks downstream usage in pgpm/core.@pgpmjs/migrate-clientis added as a dep to pgpm/core but no import/usage of it appears in this diff. Verify this is intentional (i.e., usage comes in a follow-up PR).migrate.graphqlfor any remaining search-related artifacts that shouldn't be in the base schema.pnpm --filter @constructive-io/sdk run generate:migrate-clientfrom the workspace root and confirm the output insdk/migrate-client/src/migrate/orm/looks correct.Notes
resolutionfields), not substantive dependency changes.main's latest codegen which includes the input-types-generator fixes from PRs fix(codegen): include TCondition in React hooks FindManyArgs + add VectorFilter to types.ts #818/fix(codegen): FindManyArgs TCondition slot fix + regenerate SDK from latest constructive-db #819.pnpm buildpasses cleanly, but no runtime/integration testing was performed against a live database.Requested by: @pyramation
Link to Devin Session