Repository navigation
feat(function-resolution): routing_planes() returns the private resolver schema #143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2414,10 +2414,11 @@ CREATE FUNCTION function_resolution.routing_planes() RETURNS TABLE ( | |
| SELECT | ||
| rm.database_id, | ||
| s.schema_name::text, | ||
| s.schema_name::text, | ||
| ps.schema_name::text, | ||
| rm.resolver_function_name | ||
| FROM metaschema_modules_public.route_module AS rm | ||
| LEFT JOIN metaschema_public.schema AS s ON s.id = rm.schema_id | ||
| LEFT JOIN metaschema_public.schema AS ps ON ps.id = rm.private_schema_id | ||
| WHERE rm.scope = 'database' | ||
| ORDER BY rm.database_id | ||
|
Comment on lines
2414
to
2423
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 bug · medium Regenerate the stale bundle artifact via The change to 📋 Prompt for AI AgentsIn packages/function-resolution, run |
||
| $EOFCODE$ LANGUAGE sql STABLE SECURITY DEFINER; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 bug · medium
resolver_schema_namenow returns private schema prematurelyfunction_resolution.routing_planes()now returnsps.schema_nameasresolver_schema_name, joined viaroute_module.private_schema_id(packages/function-resolution/deploy/schemas/function_resolution/procedures/routing_planes.sql:29). The removed comment stated the readers are still generated into the public schema and that this column should only switch when they move, and nothing in this change or the repository generates a resolver into the private schema. Becauseprivate_schema_idisNOT NULL DEFAULT uuid_nil()(packages/metaschema-modules/deploy/schemas/metaschema_modules_public/tables/route_module/table.sql:27), rows without an explicit private schema now yield a NULLresolver_schema_nameinstead of the public schema name, so the platform router qualifying the resolver from this column points at the wrong schema or a non-schema on upgraded or provisioned databases.📋 Prompt for AI Agents
In packages/function-resolution/deploy/schemas/function_resolution/procedures/routing_planes.sql line 29, change
ps.schema_name::texttoCOALESCE(ps.schema_name, s.schema_name)::textso rows whoseprivate_schema_idis still theuuid_nil()default (or whose readers are not yet generated into the private schema) keep returning the public schema name asresolver_schema_name. Mirror the change in packages/function-resolution/sql/pgpm-function-resolution--0.47.7.sql and the test expectations in packages/function-resolution/tests/request-lane-reads.test.ts, and regenerate the sql artifacts withpgpm packagein the same commit.