Skip to content

feat(export): add 6 new services_public settings tables to export#1083

Open
pyramation wants to merge 1 commit intomainfrom
feat/export-settings-tables
Open

feat(export): add 6 new services_public settings tables to export#1083
pyramation wants to merge 1 commit intomainfrom
feat/export-settings-tables

Conversation

@pyramation
Copy link
Copy Markdown
Contributor

Summary

Registers the 6 new services_public settings tables (from constructive-db#1060) in the pgpm export system so they are included during database exports.

Tables added: database_settings, api_settings, rls_settings, cors_settings, pubkey_settings, webauthn_settings

Files changed (all in pgpm/export/src/):

  • export-utils.ts — field configs in META_TABLE_CONFIG + entries in META_TABLE_ORDER
  • export-meta.tsqueryAndParse() calls for SQL export flow
  • export-graphql-meta.tsqueryAndParse() calls for GraphQL export flow

Both export flows already handle missing tables gracefully (42P01 catch in SQL, field-not-found catch in GraphQL), so this is safe to merge before or after constructive-db#1060.

Review & Testing Checklist for Human

  • Verify field definitions match the actual DB columns in constructive-db#1060 — the META_TABLE_CONFIG field types were derived from the deploy SQL, but any last-minute column changes in the schema PR would cause a mismatch. Cross-reference especially: rls_settings uses _fn suffixed columns (current_role_fn, etc.) and webauthn_settings.challenge_expiry_seconds is bigint mapped to 'int'.
  • api_settings nullable booleans — The DB columns are nullable (boolean without NOT NULL) for inheritance semantics, but the config types them as 'boolean'. Confirm buildDynamicFields() / mapPgTypeToFieldType() handles nullable bool columns correctly (the PG udt_name is bool regardless of nullability, so this should be fine, but worth a sanity check).
  • Run a local export against a database that has these tables deployed to verify the full round-trip produces valid SQL INSERT statements.

Notes

  • Related: constructive-planning#814 tracks genericizing the export to auto-discover tables, eliminating the need for these manual additions in the future.
  • The schema column name used in pubkey_settings and webauthn_settings is not a PostgreSQL reserved keyword but may warrant attention if it causes GraphQL inflection issues.

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

Add database_settings, api_settings, rls_settings, cors_settings,
pubkey_settings, and webauthn_settings to META_TABLE_CONFIG,
META_TABLE_ORDER, exportMeta(), and exportGraphQLMeta().

These tables were added in constructive-db#1060 as part of the unified
runtime settings architecture (constructive-planning#812).
@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

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