Skip to content

feat(export): drive meta export table list from generated manifest#1362

Merged
pyramation merged 1 commit into
mainfrom
feat/generated-meta-export-tables
Jul 12, 2026
Merged

feat(export): drive meta export table list from generated manifest#1362
pyramation merged 1 commit into
mainfrom
feat/generated-meta-export-tables

Conversation

@pyramation

Copy link
Copy Markdown
Contributor

Summary

Replaces the hand-maintained META_TABLE_ORDER / META_TABLE_CONFIG allowlists in @pgpmjs/export with a generated manifest, eliminating the drift that required one-off PRs like #1361.

  • src/meta-export-tables.json (100 tables) is generated by constructive-db from the live database (constructive-io/constructive-db#2103) and propagated here by constructive-hub's schema-propagation workflow (constructive-io/constructive-hub#577). Already FK-topo-sorted.
  • export-utils.ts:
    export const META_TABLE_ORDER: string[] = manifest.tables.map(t => t.key);
    export const META_TABLE_CONFIG = fromEntries(manifest.tables.map(t =>
      [t.key, { schema: t.schema, table: t.table, ...META_TABLE_OVERRIDES[t.key] }]));
    Hand-authored behavior stays in the new META_TABLE_OVERRIDES (field conflictDoNothing, sites/apis columnDefaults, sites/apps/site_metadata image/url typeOverrides, i18n_module gqlTypeName).
  • export-meta.ts and export-graphql-meta.ts now iterate META_TABLE_ORDER instead of ~95 hardcoded queryAndParse calls each (database keyed by id, everything else by database_id; GraphQL flow batches per schema group). Dynamic field discovery and missing-table skip behavior unchanged.

Newly exported tables (previously silently dropped): composite_type, enum, view, view_grant, view_rule, view_table, partition, embedding_chunks, db_preset_module, principal_auth_module, resource_module. Stale entries that don't exist in constructive-db drop out (rls_function, levels_module, field_module, table_module, uuid_module, api_extensions). Runtime-only tables are blacklisted at generation time (blueprint, blueprint_construction, database_provision_module, db_pool, database_transfer). Note: integration_providers_module is not in the manifest yet because its table hasn't landed in constructive-db main; it will appear automatically once it does.

Tests updated to match: parity tests validate both flows iterate the manifest, and the boolean/int cross-flow parity case was repointed from the removed rls_function to policy. All 142 export tests pass.

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

META_TABLE_ORDER and META_TABLE_CONFIG are now built from
meta-export-tables.json, generated by constructive-db from the live
database and propagated via constructive-hub's schema-propagation
workflow. Hand-authored behavior lives in META_TABLE_OVERRIDES.
Both the SQL and GraphQL export flows iterate the same manifest.
@pyramation pyramation self-assigned this Jul 12, 2026
@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, CI, and merge conflict monitoring

@pyramation pyramation merged commit fe9d51a into main Jul 12, 2026
37 checks passed
@pyramation pyramation deleted the feat/generated-meta-export-tables branch July 12, 2026 04:20
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