Skip to content

[WIP] Progressive introspection#3082

Draft
benjie wants to merge 1 commit into
mainfrom
forbidden-enum
Draft

[WIP] Progressive introspection#3082
benjie wants to merge 1 commit into
mainfrom
forbidden-enum

Conversation

@benjie

@benjie benjie commented Jul 1, 2026

Copy link
Copy Markdown
Member

Progressive introspection limits introspection to just the chosen schemas and then spiders outwards to referenced types/classes/attributes/functions/etc. This aids memory efficiency, especially for folks with lots of (repeated) schemas that aren't to be exposed, but it also helps with permissions issues - if you have one schema for one API, and one for another, and permissions differ, then enum table values in one might not need to be read by the other. We can't simply not load enum table values if they're not in the schema list because they might be referenced, for example create table public.foo(enum text references hidden.enum_table); needs to reference the hidden.enum_table values even though it's not in the public schema.

Ultimately we aim to build the same introspection object as before, but we'll do so in waves by first introspecting the main schema, then expanding outward from there based on what is actually referenced:

  • column types
  • type references (e.g. domain, array, range, etc -> these then reference another type, or maybe enum values/range details)
  • function parameters
  • function return types
  • foreign key relationships (both directions?)
  • probably not smart tags - those come at a later phase.

@changeset-bot

changeset-bot Bot commented Jul 1, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 8ee5d26

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

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