The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
Chore/move advisors (#30283)
Terry Suttondd4788bce48c
diff --git a/apps/docs/content/guides/database/extensions/index_advisor.mdx b/apps/docs/content/guides/database/extensions/index_advisor.mdxindex a1cf0d29d5e..82ab1d1df98 100644--- a/apps/docs/content/guides/database/extensions/index_advisor.mdx+++ b/apps/docs/content/guides/database/extensions/index_advisor.mdx@@ -13,7 +13,7 @@ Features:- Identifies tables/columns obfuscated by views- Skips duplicate indexes-`index_advisor` is accessible directly through Supabase Studio by navigating to the [Query Performance Report](/dashboard/project/_/database/query-performance) and selecting a query and then the "indexes" tab.+`index_advisor` is accessible directly through Supabase Studio by navigating to the [Query Performance Report](/dashboard/project/_/advisors/query-performance) and selecting a query and then the "indexes" tab.diff --git a/apps/docs/content/guides/database/postgres/indexes.mdx b/apps/docs/content/guides/database/postgres/indexes.mdxindex 9796f952733..c8d96b6cbb9 100644--- a/apps/docs/content/guides/database/postgres/indexes.mdx+++ b/apps/docs/content/guides/database/postgres/indexes.mdx@@ -121,7 +121,7 @@ For more information on the Index Advisor and its suggestions, see the [`index_aTo use the Dashboard Index Advisor:-1. Go to the [Query Performance](/dashboard/project/_/database/query-performance) page.+1. Go to the [Query Performance](/dashboard/project/_/advisors/query-performance) page.1. Click on a query to bring up the Details side panel.1. Select the Indexes tab.1. Enable Index Advisor if prompted.diff --git a/apps/docs/content/guides/database/postgres/timeouts.mdx b/apps/docs/content/guides/database/postgres/timeouts.mdxindex 1b41032cbd4..8a735c9d7c1 100644--- a/apps/docs/content/guides/database/postgres/timeouts.mdx+++ b/apps/docs/content/guides/database/postgres/timeouts.mdx@@ -153,7 +153,7 @@ limit 100;### Using the Query Performance page-Go to the [Query Performance page](/dashboard/project/_/database/query-performance?preset=slowest_execution) and filter by relevant role and query speeds. This only identifies slow-running but successful queries. Unlike the Log Explorer, it does not show you timed-out queries.+Go to the [Query Performance page](/dashboard/project/_/advisors/query-performance?preset=slowest_execution) and filter by relevant role and query speeds. This only identifies slow-running but successful queries. Unlike the Log Explorer, it does not show you timed-out queries.### Understanding roles in logsdiff --git a/apps/docs/content/guides/database/prisma.mdx b/apps/docs/content/guides/database/prisma.mdxindex 9d721a2211a..af9727e9dfe 100644--- a/apps/docs/content/guides/database/prisma.mdx+++ b/apps/docs/content/guides/database/prisma.mdx@@ -17,8 +17,8 @@ If you plan to solely use Prisma instead of the Supabase Data API (PostgREST), t<StepHikeCompact><StepHikeCompact.Step step={1}><StepHikeCompact.Details title="Create a custom user for Prisma">- - In the [SQL Editor](https://supabase.com/dashboard/project/_/sql/new), create a Prisma db-user with full privileges on the public schema.- - This gives you better control over Prisma's access and makes it easier to monitor using Supabase tools like the [Query Performance Dashboard](https://supabase.com/dashboard/project/_/database/query-performance) and [Log Explorer](https://supabase.com/dashboard/project/_/logs/explorer).+ - In the [SQL Editor](https://supabase.com/dashboard/project/_/sql/new), create a Prisma db-user with full privileges on the public schema.+ - This gives you better control over Prisma's access and makes it easier to monitor using Supabase tools like the [Query Performance Dashboard](https://supabase.com/dashboard/project/_/advisors/query-performance) and [Log Explorer](https://supabase.com/dashboard/project/_/logs/explorer).<Admonition type="note" label="password manager">For security, consider using a [password generator](https://bitwarden.com/password-generator/) for the Prisma role.diff --git a/apps/studio/components/layouts/AdvisorsLayout/AdvisorsMenu.utils.ts b/apps/studio/components/layouts/AdvisorsLayout/AdvisorsMenu.utils.tsindex 7fa45781406..b2a1073bb9b 100644--- a/apps/studio/components/layouts/AdvisorsLayout/AdvisorsMenu.utils.ts+++ b/apps/studio/components/layouts/AdvisorsLayout/AdvisorsMenu.utils.ts@@ -9,17 +9,23 @@ export const generateAdvisorsMenu = (project?: Project): ProductMenuGroup[] => {title: 'Advisors',items: [{- name: 'Security',+ name: 'Security Advisor',key: 'security',url: `/project/${ref}/advisors/security`,items: [],},{- name: 'Performance',+ name: 'Performance Advisor',key: 'performance',url: `/project/${ref}/advisors/performance`,items: [],},+ {+ name: 'Query Performance',+ key: 'query-performance',+ url: `/project/${ref}/advisors/query-performance`,+ items: [],+ },],},]diff --git a/apps/studio/components/layouts/DatabaseLayout/DatabaseLayout.tsx b/apps/studio/components/layouts/DatabaseLayout/DatabaseLayout.tsxindex a8c31f291ef..82594b17652 100644--- a/apps/studio/components/layouts/DatabaseLayout/DatabaseLayout.tsx+++ b/apps/studio/components/layouts/DatabaseLayout/DatabaseLayout.tsx@@ -7,7 +7,6 @@ import { useDatabaseExtensionsQuery } from 'data/database-extensions/database-eximport { useProjectAddonsQuery } from 'data/subscriptions/project-addons-query'import { useSelectedProject } from 'hooks/misc/useSelectedProject'import { withAuth } from 'hooks/misc/withAuth'-import { useFlag } from 'hooks/ui/useFlag'import ProjectLayout from '../ProjectLayout/ProjectLayout'import { generateDatabaseMenu } from './DatabaseMenu.utils'@@ -30,7 +29,6 @@ const DatabaseProductMenu = () => {const pgNetExtensionExists = (data ?? []).find((ext) => ext.name === 'pg_net') !== undefinedconst pitrEnabled = addons?.selected_addons.find((addon) => addon.type === 'pitr') !== undefinedconst columnLevelPrivileges = useIsColumnLevelPrivilegesEnabled()- const cronUiEnabled = useFlag('cronUi')return (<>@@ -40,7 +38,6 @@ const DatabaseProductMenu = () => {pgNetExtensionExists,pitrEnabled,columnLevelPrivileges,- cronUiEnabled,})}/></>diff --git a/apps/studio/components/layouts/DatabaseLayout/DatabaseMenu.utils.tsx b/apps/studio/components/layouts/DatabaseLayout/DatabaseMenu.utils.tsxindex ec80389df06..c80e7e5b632 100644--- a/apps/studio/components/layouts/DatabaseLayout/DatabaseMenu.utils.tsx+++ b/apps/studio/components/layouts/DatabaseLayout/DatabaseMenu.utils.tsx@@ -9,16 +9,21 @@ export const generateDatabaseMenu = (pgNetExtensionExists: booleanpitrEnabled: booleancolumnLevelPrivileges: boolean- cronUiEnabled: boolean}): ProductMenuGroup[] => {const ref = project?.ref ?? 'default'- const { pgNetExtensionExists, pitrEnabled, columnLevelPrivileges, cronUiEnabled } = flags || {}+ const { pgNetExtensionExists, pitrEnabled, columnLevelPrivileges } = flags || {}return [{title: 'Database Management',items: [+ {+ name: 'Schema Visualizer',+ key: 'schemas',+ url: `/project/${ref}/database/schemas`,+ items: [],+ },{ name: 'Tables', key: 'tables', url: `/project/${ref}/database/tables`, items: [] },{name: 'Functions',@@ -127,18 +132,6 @@ export const generateDatabaseMenu = ({title: 'Tools',items: [- {- name: 'Schema Visualizer',- key: 'schemas',- url: `/project/${ref}/database/schemas`,- items: [],- },- {- name: 'Query Performance',- key: 'query-performance',- url: `/project/${ref}/database/query-performance`,- items: [],- },{name: 'Security Advisor',key: 'security-advisor',@@ -153,6 +146,13 @@ export const generateDatabaseMenu = (rightIcon: <ArrowUpRight strokeWidth={1} className="h-4 w-4" />,items: [],},+ {+ name: 'Query Performance',+ key: 'query-performance',+ url: `/project/${ref}/advisors/query-performance`,+ rightIcon: <ArrowUpRight strokeWidth={1} className="h-4 w-4" />,+ items: [],+ },],},]diff --git a/apps/studio/components/layouts/ProjectLayout/NavigationBar/NavigationBar.utils.tsx b/apps/studio/components/layouts/ProjectLayout/NavigationBar/NavigationBar.utils.tsxindex 8b807064bc6..3b92106f0d6 100644--- a/apps/studio/components/layouts/ProjectLayout/NavigationBar/NavigationBar.utils.tsx+++ b/apps/studio/components/layouts/ProjectLayout/NavigationBar/NavigationBar.utils.tsx@@ -62,7 +62,7 @@ export const generateProductRoutes = ((isProjectBuilding? buildingUrl: isProjectActive- ? `/project/${ref}/database/tables`+ ? `/project/${ref}/database/schemas`: `/project/${ref}/database/backups/scheduled`),},...(authEnableddiff --git a/apps/studio/next.config.js b/apps/studio/next.config.jsindex cd9c8737efa..75b21301149 100644--- a/apps/studio/next.config.js+++ b/apps/studio/next.config.js@@ -372,7 +372,12 @@ const nextConfig = {{permanent: true,source: '/project/:ref/reports/query-performance',- destination: '/project/:ref/database/query-performance',+ destination: '/project/:ref/advisors/query-performance',+ },+ {+ permanent: true,+ source: '/project/:ref/database/query-performance',+ destination: '/project/:ref/advisors/query-performance',},{permanent: true,diff --git a/apps/studio/pages/project/[ref]/database/query-performance.tsx b/apps/studio/pages/project/[ref]/advisors/query-performance.tsxsimilarity index 94%rename from apps/studio/pages/project/[ref]/database/query-performance.tsxrename to apps/studio/pages/project/[ref]/advisors/query-performance.tsxindex 9264683fce3..6ec244ce9b1 100644--- a/apps/studio/pages/project/[ref]/database/query-performance.tsx+++ b/apps/studio/pages/project/[ref]/advisors/query-performance.tsx@@ -10,7 +10,7 @@ import {} from 'components/interfaces/Reports/Reports.queries'import { Presets } from 'components/interfaces/Reports/Reports.types'import { queriesFactory } from 'components/interfaces/Reports/Reports.utils'-import DatabaseLayout from 'components/layouts/DatabaseLayout/DatabaseLayout'+import AdvisorsLayout from 'components/layouts/AdvisorsLayout/AdvisorsLayout'import DatabaseSelector from 'components/ui/DatabaseSelector'import { FormHeader } from 'components/ui/Forms/FormHeader'import type { NextPageWithLayout } from 'types'@@ -58,7 +58,7 @@ const QueryPerformanceReport: NextPageWithLayout = () => {}QueryPerformanceReport.getLayout = (page) => (- <DatabaseLayout title="Query performance">{page}</DatabaseLayout>+ <AdvisorsLayout title="Query performance">{page}</AdvisorsLayout>)export default QueryPerformanceReportdiff --git a/packages/shared-data/extensions.json b/packages/shared-data/extensions.jsonindex 58201347416..d9aaf5bde8a 100644--- a/packages/shared-data/extensions.json+++ b/packages/shared-data/extensions.json@@ -177,7 +177,7 @@"link": "/guides/database/extensions/index_advisor","github_url": "https://github.com/supabase/index_advisor","product": "Index Advisor Report",- "product_url": "/project/{ref}/database/query-performance"+ "product_url": "/project/{ref}/advisors/query-performance"},{"name": "intarray",@@ -303,7 +303,7 @@"link": "/guides/database/extensions/pg_stat_statements","github_url": null,"product": "Query Performance",- "product_url": "/project/{ref}/database/query-performance"+ "product_url": "/project/{ref}/advisors/query-performance"},{"name": "pg_surgery",