feat: add @pgpmjs/migrate-client workspace package for typed Migrate API access#824
Open
pyramation wants to merge 1 commit intomainfrom
Open
feat: add @pgpmjs/migrate-client workspace package for typed Migrate API access#824pyramation wants to merge 1 commit intomainfrom
pyramation wants to merge 1 commit intomainfrom
Conversation
…API access - Create sdk/migrate-client/ with typed ORM client generated from migrate.graphql schema - Models: SqlActionModel, MigrateFileModel with findMany/findFirst/create/update/delete - Mutations: executeSql, runMigration - Zero codegen runtime deps (gql-ast, @0no-co/graphql.web, @constructive-io/graphql-types) - Add pnpm generate script for future regeneration via @constructive-io/graphql-codegen - Add @pgpmjs/migrate-client as workspace dependency in pgpm/core
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.
feat: add @pgpmjs/migrate-client workspace package
Summary
Adds a new workspace package at
sdk/migrate-client/that provides a typed GraphQL ORM client for the Constructive Migrate API (db_migrateschema). This package will be consumed bypgpm/coreto replace ~1,300 lines of handwritten GraphQL boilerplate in the export flow (on thefeature/pgpm-export-graphqlbranch).Package contents:
schemas/migrate.graphql— static copy of thedb_migrateGraphQL schema from constructive-dbSqlActionModel,MigrateFileModel(findMany/findFirst/create/update/delete)executeSql,runMigrationscripts/generate.ts— regeneration script using@constructive-io/graphql-codegen(devDep only)Runtime dependencies are minimal:
gql-ast,@0no-co/graphql.web,@constructive-io/graphql-types,graphql. No codegen dependency at runtime.This PR also adds
@pgpmjs/migrate-clientas aworkspace:^dependency inpgpm/core/package.json, but no code inpgpm/coreimports it yet — the actual usage will land via the export PR onfeature/pgpm-export-graphql.Review & Testing Checklist for Human
pnpm generatescript requiresgraphile-connection-filter(transitive codegen dep) which wasn't available in the build environment. The committed ORM files were copied from constructive-db's existing generated output. Verify thatpnpm generateworks in a fully-configured environment and produces identical output.sdk/migrate-client/schemas/migrate.graphqlis a one-time copy from constructive-db. If the upstreamdb_migrateschema changes, this file must be manually re-copied andpnpm generatere-run. Consider whether an automated sync is warranted.pnpm-lock.yamldiff is ~90% YAML formatting changes (brace style). The substantive additions are only thesdk/migrate-clientimporter block and the@pgpmjs/migrate-clientlink inpgpm/core. Spot-check for unexpected dependency changes.pnpm buildfrom workspace root —sdk/migrate-clientandpgpm/coreshould both compile cleanly. Note: concurrent workspace builds can race (migrate-client'sdistgets deleted while core compiles); building migrate-client first avoids this.Notes