Skip to content

feat(app-scope): add routing_tables scoped table-name resolution#105

Merged
pyramation merged 1 commit into
mainfrom
feat/app-scope-routing-tables
Jul 26, 2026
Merged

feat(app-scope): add routing_tables scoped table-name resolution#105
pyramation merged 1 commit into
mainfrom
feat/app-scope-routing-tables

Conversation

@pyramation

Copy link
Copy Markdown
Contributor

Summary

Upstreams app_scope.routing_tables from constructive-db (landed there in constructive-io/constructive-db#2492), where it was moved out of metaschema_generators into app_scope beside frames.

routing_tables(database_id uuid, scope text) resolves the physical (schema, table) names of the scoped routing source/settings tables (apis + companions, sites + companions, domains/managed_domains, routes, apps + apps_key_column) for an execution at the given scope: it walks app_scope.frames(database_id, scope) and joins the metaschema_modules_public.*_module registration tables (api_surface_module, site_surface_module, domain_module, route_module, app_module), preferring an exact-scope frame then the most specific one — independently per surface. The table_id -> (schema, table) lookup is inlined as a join over metaschema_public.table/schema (no metaschema-utils dependency), raising ROUTING_TABLES_NOT_FOUND naming the offending module when a registration points at a missing table.

Standard triple (deploy/verify/revert) + plan entry after frames; pgpm-app-scope.control already required metaschema-schema,metaschema-modules. Package tests green locally.

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

Resolves the physical (schema, table) names of the scoped routing/site/
domain/route/app source and settings tables for a (database_id, scope)
execution by walking app_scope.frames and joining the metaschema module
registration tables; exact-scope frames win, then most-specific, per
surface independently. Ported from constructive-db where it now lives in
app_scope (moved out of metaschema_generators).
@pyramation pyramation self-assigned this Jul 26, 2026
@devin-ai-integration

Copy link
Copy Markdown

🤖 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 fc3fe54 into main Jul 26, 2026
24 checks passed
@pyramation
pyramation deleted the feat/app-scope-routing-tables branch July 26, 2026 19:36
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