Skip to content

fix: update @pgpmjs/core export config for grantee_name rename and add default_privilege table#752

Merged
pyramation merged 1 commit intomainfrom
devin/1772239125-grantee-name-upstream
Feb 28, 2026
Merged

fix: update @pgpmjs/core export config for grantee_name rename and add default_privilege table#752
pyramation merged 1 commit intomainfrom
devin/1772239125-grantee-name-upstream

Conversation

@pyramation
Copy link
Copy Markdown
Contributor

fix: update export config for grantee_name rename and default_privilege

Summary

Upstream the changes from the @pgpmjs/core pnpm patch in constructive-db#542 into the source package. That PR renamed role_namegrantee_name on table_grant, view_grant, and policy tables in metaschema_public, added is_grant to table_grant/view_grant, and created a new default_privilege table.

Changes in export-meta.ts:

  • policy config: role_namegrantee_name
  • table_grant config: role_namegrantee_name, add is_grant: 'boolean'
  • New default_privilege table config (schema_id, object_type, privilege, grantee_name, is_grant)
  • Add queryAndParse call for default_privilege after table_grant

Changes in export-migrations.ts:

  • Add 'default_privilege' to tableOrder after 'table_grant'

services_public.apis.role_name is intentionally unchanged (different semantic context — API owner role, not a privilege grantee).

Review & Testing Checklist for Human

⚠️ 3 items — this is a config-only change but cannot be tested without the companion DB schema changes.

  • Verify field lists match the actual DB schema — The default_privilege fields (id, database_id, schema_id, object_type, privilege, grantee_name, is_grant) must exactly match the columns on metaschema_public.default_privilege as deployed by constructive-db#542. Same for table_grant (now has grantee_name + is_grant) and policy (now has grantee_name). Any mismatch will cause buildDynamicFields to silently drop columns.
  • view_grant is still not in the export config — The companion PR added is_grant and renamed role_namegrantee_name on view_grant too, but view_grant was never in the export config to begin with. Confirm this is intentional (i.e., view grants are not exported via this path).
  • Test end-to-end — After publishing, update constructive-db to use the new version, remove the patches/@pgpmjs__core@6.3.0.patch, and run the full CI suite to confirm the generate step still passes without the patch.

Notes

…vilege table

- policy config: role_name -> grantee_name
- table_grant config: role_name -> grantee_name, add is_grant field
- Add default_privilege table config with all fields
- Add default_privilege queryAndParse call
- Add default_privilege to tableOrder in export-migrations
@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 merged commit ac3943a into main Feb 28, 2026
43 checks passed
@pyramation pyramation deleted the devin/1772239125-grantee-name-upstream branch February 28, 2026 00:48
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