Skip to content

feat: re-export getDbConnections and types for two-phase test patterns#1022

Closed
pyramation wants to merge 1 commit intomainfrom
devin/1776738757-expose-db-connections
Closed

feat: re-export getDbConnections and types for two-phase test patterns#1022
pyramation wants to merge 1 commit intomainfrom
devin/1776738757-expose-db-connections

Conversation

@pyramation
Copy link
Copy Markdown
Contributor

Summary

Re-exports low-level DB connection utilities from pgsql-test through @constructive-io/graphql-test so that tests needing a two-phase pattern can import everything from the framework without reaching down to pgsql-test directly.

New exports:

  • getDbConnections — alias for pgsql-test's getConnections (raw DB connections without GraphQL schema build)
  • GetConnectionResult, GetConnectionOpts types from pgsql-test
  • PgTestClient type from pgsql-test/test-client

Why: 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 call getDbConnections() for phase 1 and GraphQLTest() for phase 2, all from framework imports.

This follows the existing pattern where seed and snapshot are already re-exported from pgsql-test (line 16).

Review & Testing Checklist for Human

  • Verify getDbConnections doesn't conflict with the existing getConnections export from ./get-connections (different names, but worth confirming no ambiguity for consumers)
  • Confirm the pgsql-test/test-client subpath export resolves correctly at the consumer side (it's already used internally in get-connections.ts, so should be fine)

Notes

  • This is a pure re-export change — no logic modified
  • The consuming PR is constructive-db#934 which will switch its pgsql-test direct import to use getDbConnections from this package instead

Link to Devin session: https://app.devin.ai/sessions/18879be982854a40abe5c9b915aa4a84
Requested by: @pyramation

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.
@devin-ai-integration
Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@pyramation pyramation closed this Apr 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant