fix: Support non-public PostgreSQL schemas in resource generator #631
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.
This PR fixes the resource generator to properly handle tables in non-public PostgreSQL schemas (e.g.,
inventory.products
,ocloud.roles
). Previously, the generator would fail when attempting to introspect tables outside thepublic
schema. e.g.:Two issues have been fixed:
When generating resources from tables like
ocloud.roles
, PostgreSQL queries would fail withERROR 42P01 (undefined_table) relation "roles" does not exist
because unqualified table names were used in introspection queries.After generating resources, the migration generator would crash with
could not list directory "priv/resource_snapshots/repo/roles": no such file or directory
because it tried to ls snapshot directories based on unqualified table names.The following changes were made:
schema.table
) in all PostgreSQL introspection queries for foreign keys, check constraints, and indexesschema
option to postgres configuration for generated resources when schema is not "public"Contributor checklist
Leave anything that you believe does not apply unchecked.
, or AI was not used in the creation of this PR.(Claude Code assisted in the development of this PR)