Files
supabase/apps/studio/data/tables/keys.ts
T
Aaron Byrne 205dac33da feat: Adding a more lightweight query to pg-meta that just fetches the table names (#44469)
Bug fix & feature

## What is the current behavior?

Customers with large schemas have trouble running:
pg-meta/{ref}/tables?include_columns=false

## What is the new behavior?

In the webhooks view some users with large schemas could not click a
table name as the underlying query times out. This just adds a light
weight query and fetches the table name
## Additional context

Add any other context or screenshots.

## Summary by CodeRabbit

* **Refactor**
* Optimized table name fetching in the database interface by introducing
an enhanced query mechanism that streams table metadata more efficiently
from the database.
2026-04-06 09:57:08 -04:00

14 lines
580 B
TypeScript

export const tableKeys = {
names: (projectRef: string | undefined) => ['projects', projectRef, 'table-names'] as const,
list: (projectRef: string | undefined, schema?: string, includeColumns?: boolean) =>
['projects', projectRef, 'tables', schema, includeColumns].filter(Boolean),
retrieve: (projectRef: string | undefined, name: string, schema: string) =>
['projects', projectRef, 'table', schema, name].filter(Boolean),
rolesAccess: (projectRef: string | undefined, schema: string) => [
'projects',
projectRef,
'roles-access',
{ schema },
],
}