Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

fix: keep role view (#46426)

Vaibhav02422bed2c35
diff --git a/apps/studio/components/grid/components/header/Header.tsx b/apps/studio/components/grid/components/header/Header.tsx
index efaf1c26acc..0ea1eb2e2fe 100644
--- a/apps/studio/components/grid/components/header/Header.tsx
+++ b/apps/studio/components/grid/components/header/Header.tsx
@@ -259,11 +259,17 @@ const RowHeader = ({ tableQueriesEnabled = true }: RowHeaderProps) => {
}
const exportParams = snap.allRowsSelected
- ? ({ type: 'fetch_all', filters, sorts } as const)
+ ? ({
+ type: 'fetch_all',
+ filters,
+ sorts,
+ roleImpersonationState: roleImpersonationState as RoleImpersonationState,
+ } as const)
: ({
type: 'provided_rows',
table: snap.table,
rows: allRows.filter((x) => snap.selectedRows.has(x.idx)),
+ roleImpersonationState: roleImpersonationState as RoleImpersonationState,
} as const)
const { exportCsv, confirmationModal: exportCsvConfirmationModal } = useExportAllRowsAsCsv(
diff --git a/apps/studio/components/layouts/TableEditorLayout/ExportAllRows.tsx b/apps/studio/components/layouts/TableEditorLayout/ExportAllRows.tsx
index 259cfbb931d..c20db337c0e 100644
--- a/apps/studio/components/layouts/TableEditorLayout/ExportAllRows.tsx
+++ b/apps/studio/components/layouts/TableEditorLayout/ExportAllRows.tsx
@@ -259,6 +259,7 @@ type UseExportAllRowsParams =
type: 'provided_rows'
table: SupaTable
rows: Record<string, unknown>[]
+ roleImpersonationState?: RoleImpersonationState
}
))
@@ -297,6 +298,7 @@ export const useExportAllRowsGeneric = (
table: params.table,
projectRef,
connectionString,
+ roleImpersonationState: params.roleImpersonationState,
})
if (hydrated.status === 'no_primary_key') {
return {