Repository navigation
fix: schema qualifer reference - #124
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes schema qualifier references by standardizing the schema name from utils to util and removing redundant schema prefixes when objects reference types within their own schema. The changes ensure that dumped schemas use unqualified type references when the type is defined in the same schema, matching PostgreSQL's pg_dump behavior.
Key changes:
- Renamed schema from
utilstoutilfor consistency - Updated code generation to strip schema prefixes from data types, return types, and composite type attributes when they match the target schema
- Restructured tenant schema tests to load the same SQL into public, tenant1, and tenant2 schemas
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| testdata/dump/tenant/util.sql | Renamed schema from utils to util and updated function references |
| testdata/dump/tenant/tenant.sql | New file containing complete schema definition with cross-schema type references and util function calls |
| testdata/dump/tenant/public.sql | Removed file - types and tables now defined in tenant.sql instead |
| testdata/dump/tenant/pgschema.sql | Added type definitions and removed schema qualifiers from type references within the same schema |
| internal/diff/type.go | Added logic to strip schema prefix from composite type attributes |
| internal/diff/procedure.go | Updated parameter formatting to strip schema prefixes for target schema |
| internal/diff/function.go | Updated parameter and return type formatting to strip schema prefixes |
| cmd/dump/dump_integration_test.go | Restructured test to load tenant.sql into public, tenant1, and tenant2 schemas |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
tianzhou
added a commit
that referenced
this pull request
Oct 27, 2025
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.
Fix #123