Skip to content

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

Merged
pyramation merged 2 commits intomainfrom
feat/export-settings-tables
May 9, 2026
Merged

feat(export): add 6 new services_public settings tables to export#1083
pyramation merged 2 commits intomainfrom
feat/export-settings-tables

Conversation

@pyramation
Copy link
Copy Markdown
Contributor

@pyramation pyramation commented May 9, 2026

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.

Updates since last revision

The field configs for rls_settings, pubkey_settings, and webauthn_settings were updated to match the text→UUID FK conversion in constructive-db#1060 (#816, #817):

  • rls_settings: Schema/function text fields → UUID FK fields (e.g. authenticate_schemaauthenticate_schema_id, current_role_fncurrent_role_function_id)
  • pubkey_settings: schemaschema_id, function text fields → *_function_id uuid fields
  • webauthn_settings: Schema text fields → *_schema_id, table text fields → *_table_id, added user_field_id uuid FK

database_settings, api_settings, and cors_settings remain unchanged.

Review & Testing Checklist for Human

  • Cross-reference field names with constructive-db#1060 deploy SQL — The UUID FK field names in META_TABLE_CONFIG (e.g. authenticate_function_id, sign_up_with_key_function_id, credentials_table_id) must exactly match the column names in the corresponding deploy .sql files. A mismatch won't cause errors (the dynamic field builder silently skips missing columns) but will cause silent data omission during exports.
  • 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 (after merging constructive-db#1060) to verify the full round-trip produces valid SQL INSERT statements, especially for the UUID FK columns.

Notes

  • Related: constructive-planning#814 tracks genericizing the export to auto-discover tables, eliminating the need for these manual additions in the future.

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

- rls_settings: schema/function text fields → uuid FK fields
- pubkey_settings: schema/function text fields → uuid FK fields
- webauthn_settings: schema/table/field text fields → uuid FK fields
- Matches constructive-db PR #1060 schema changes for #816 and #817
@pyramation pyramation merged commit 15860ff into main May 9, 2026
54 checks passed
@pyramation pyramation deleted the feat/export-settings-tables branch May 9, 2026 17:47
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