feat: re-export getDbConnections and types for two-phase test patterns#1022
Closed
pyramation wants to merge 1 commit intomainfrom
Closed
feat: re-export getDbConnections and types for two-phase test patterns#1022pyramation wants to merge 1 commit intomainfrom
pyramation wants to merge 1 commit intomainfrom
Conversation
Re-exports getConnections (as getDbConnections), GetConnectionResult, GetConnectionOpts, and PgTestClient from pgsql-test through the @constructive-io/graphql-test package. This enables tests that need to provision a database first (creating dynamic tables), then build a GraphQL schema over those tables in a second phase — without importing pgsql-test directly.
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
Re-exports low-level DB connection utilities from
pgsql-testthrough@constructive-io/graphql-testso that tests needing a two-phase pattern can import everything from the framework without reaching down topgsql-testdirectly.New exports:
getDbConnections— alias forpgsql-test'sgetConnections(raw DB connections without GraphQL schema build)GetConnectionResult,GetConnectionOptstypes frompgsql-testPgTestClienttype frompgsql-test/test-clientWhy: Some integration tests (e.g. presigned-url download tests in constructive-db PR #934) need to provision a database first (which creates dynamic schemas/tables via DDL), then build a GraphQL schema over those tables in a second phase. The existing
getConnections()bundles both steps atomically — schemas must be known upfront before seeds run. These re-exports let tests callgetDbConnections()for phase 1 andGraphQLTest()for phase 2, all from framework imports.This follows the existing pattern where
seedandsnapshotare already re-exported frompgsql-test(line 16).Review & Testing Checklist for Human
getDbConnectionsdoesn't conflict with the existinggetConnectionsexport from./get-connections(different names, but worth confirming no ambiguity for consumers)pgsql-test/test-clientsubpath export resolves correctly at the consumer side (it's already used internally inget-connections.ts, so should be fine)Notes
pgsql-testdirect import to usegetDbConnectionsfrom this package insteadLink to Devin session: https://app.devin.ai/sessions/18879be982854a40abe5c9b915aa4a84
Requested by: @pyramation