Skip to content

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

chore: Reorder database links (#22835)

Jonathan Summers-Muirc59141f83c69
diff --git a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts
index bf1e5bda20e..aa792a59a5a 100644
--- a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts
+++ b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts
@@ -609,10 +609,6 @@ export const auth = {
{ name: 'Managing User Data', url: '/guides/auth/managing-user-data' },
{ name: 'Multi-Factor Authentication', url: '/guides/auth/auth-mfa' },
{ name: 'Row Level Security', url: '/guides/auth/row-level-security' },
- {
- name: 'Column Level Security',
- url: '/guides/auth/column-level-security',
- },
{
name: 'Custom Claims & RBAC',
url: '/guides/auth/custom-claims-and-role-based-access-control-rbac',
@@ -775,6 +771,10 @@ export const database: NavMenuConstant = {
name: 'Superuser Access and Unsupported Operations',
url: '/guides/database/postgres/roles-superuser',
},
+ {
+ name: 'Column level privileges',
+ url: '/guides/database/postgres/column-level-privileges',
+ },
],
},
{
diff --git a/apps/docs/content/guides/auth/auth-helpers/remix.mdx b/apps/docs/content/guides/auth/auth-helpers/remix.mdx
index c7ed4671f46..df032be0944 100644
--- a/apps/docs/content/guides/auth/auth-helpers/remix.mdx
+++ b/apps/docs/content/guides/auth/auth-helpers/remix.mdx
@@ -771,7 +771,7 @@ export default function Index() {
</Tabs>
-> Ensure you have [enabled replication](https://supabase.com/dashboard/project/_/database/replication) on the table you are subscribing to.
+> Ensure you have [enabled replication](https://supabase.com/dashboard/project/_/database/publications) on the table you are subscribing to.
## Migration guide
diff --git a/apps/docs/content/guides/auth/column-level-security.mdx b/apps/docs/content/guides/database/postgres/column-level-security.mdx
similarity index 98%
rename from apps/docs/content/guides/auth/column-level-security.mdx
rename to apps/docs/content/guides/database/postgres/column-level-security.mdx
index 5525f6551b0..7cdc62d6c2c 100644
--- a/apps/docs/content/guides/auth/column-level-security.mdx
+++ b/apps/docs/content/guides/database/postgres/column-level-security.mdx
@@ -76,7 +76,7 @@ This time, we are revoking the column-level `UPDATE` privilege of the `title` co
## Manage column privileges in the Dashboard
-You can view and edit the privileges in the [Supabase Studio](https://supabase.com/dashboard/project/_/auth/column-privileges).
+You can view and edit the privileges in the [Supabase Studio](https://supabase.com/dashboard/project/_/database/column-privileges).
![Column level privileges](/docs/img/guides/privileges/column-level-privileges-2.png)
diff --git a/apps/docs/content/guides/database/replication.mdx b/apps/docs/content/guides/database/replication.mdx
index 7721b2e4eac..18f2d05a604 100644
--- a/apps/docs/content/guides/database/replication.mdx
+++ b/apps/docs/content/guides/database/replication.mdx
@@ -14,7 +14,7 @@ Replication is done through _publications_, a method of choosing which changes t
## Manage publications in the dashboard
1. Go to the [Database](https://supabase.com/dashboard/project/_/database/tables) page in the Dashboard.
-2. Click on **Replication** in the sidebar.
+2. Click on **Publications** in the sidebar.
3. Control which database events are sent by toggling **Insert**, **Update**, and **Delete**.
4. Control which tables broadcast changes by selecting **Source** and toggling each table.
diff --git a/apps/docs/content/guides/platform/going-into-prod.mdx b/apps/docs/content/guides/platform/going-into-prod.mdx
index 765375d4fe6..6d56253bd04 100644
--- a/apps/docs/content/guides/platform/going-into-prod.mdx
+++ b/apps/docs/content/guides/platform/going-into-prod.mdx
@@ -17,7 +17,7 @@ After developing your project and deciding it's Production Ready, you should run
- [Learn more about RLS](/docs/guides/auth/row-level-security).
- Enable replication on tables containing sensitive data by enabling Row Level Security (RLS) and setting row security policies:
- Go to the Authentication > Policies page in the Supabase Dashboard to enable RLS and create security policies.
- - Go to the Database > Replication page in the Supabase Dashboard to manage replication tables.
+ - Go to the Database > Publications page in the Supabase Dashboard to manage replication tables.
- Turn on [SSL Enforcement](/docs/guides/platform/ssl-enforcement)
- Enable [Network Restrictions](/docs/guides/platform/network-restrictions) for your database.
- Enable 2FA on GitHub. Since your GitHub account gives you administrative rights to your Supabase project, you should protect it with a strong password and 2FA using a U2F key or a TOTP app.
diff --git a/apps/docs/content/guides/platform/migrating-and-upgrading-projects.mdx b/apps/docs/content/guides/platform/migrating-and-upgrading-projects.mdx
index 592559d202b..a0850ee178f 100644
--- a/apps/docs/content/guides/platform/migrating-and-upgrading-projects.mdx
+++ b/apps/docs/content/guides/platform/migrating-and-upgrading-projects.mdx
@@ -200,7 +200,7 @@ supabase db diff --linked --schema auth,storage > changes.sql
### Enable publication on tables
-Replication for Realtime is disabled for all tables in your new project. On the [Replication](https://supabase.com/dashboard/project/_/database/replication) page in the Dashboard, select your new project and enable replication for tables that were enabled in your old project.
+Replication for Realtime is disabled for all tables in your new project. On the [Publications](https://supabase.com/dashboard/project/_/database/publications) page in the Dashboard, select your new project and enable replication for tables that were enabled in your old project.
### Migrate storage objects
diff --git a/apps/docs/content/guides/realtime.mdx b/apps/docs/content/guides/realtime.mdx
index 8bf656ed6ba..80cf895d32b 100644
--- a/apps/docs/content/guides/realtime.mdx
+++ b/apps/docs/content/guides/realtime.mdx
@@ -25,7 +25,7 @@ By default Realtime is disabled on your database. Let's turn on Realtime for a `
<TabPanel id="dashboard" label="Dashboard">
1. Go to the [Database](https://supabase.com/dashboard/project/_/database/tables) page in the Dashboard.
-2. Click on **Replication** in the sidebar.
+2. Click on **Publications** in the sidebar.
3. Control which database events are sent by toggling **Insert**, **Update**, and **Delete**.
4. Control which tables broadcast changes by selecting **Source** and toggling each table.
diff --git a/apps/docs/content/guides/realtime/postgres-changes.mdx b/apps/docs/content/guides/realtime/postgres-changes.mdx
index 134ca62edd1..14e05cbbd62 100644
--- a/apps/docs/content/guides/realtime/postgres-changes.mdx
+++ b/apps/docs/content/guides/realtime/postgres-changes.mdx
@@ -89,7 +89,7 @@ In this example we'll set up a database table, secure it with Row Level Security
<StepHikeCompact.Details title="Enable Postgres replication">
- Go to your project's [Replication settings](https://supabase.com/dashboard/project/_/database/replication), and under `supabase_realtime`, toggle on the tables you want to listen to.
+ Go to your project's [Publications settings](https://supabase.com/dashboard/project/_/database/publications), and under `supabase_realtime`, toggle on the tables you want to listen to.
</StepHikeCompact.Details>
diff --git a/apps/studio/components/interfaces/App/FeaturePreview/CLSPreview.tsx b/apps/studio/components/interfaces/App/FeaturePreview/CLSPreview.tsx
index bfff28e84f1..2ba030e0281 100644
--- a/apps/studio/components/interfaces/App/FeaturePreview/CLSPreview.tsx
+++ b/apps/studio/components/interfaces/App/FeaturePreview/CLSPreview.tsx
@@ -44,7 +44,7 @@ const CLSPreview = () => {
<li>
<Markdown
className="text-foreground-light"
- content={`Grant access to a new UI for granting and/or revoking column-level privileges [here](/project/${ref}/auth/column-privileges).`}
+ content={`Grant access to a new UI for granting and/or revoking column-level privileges [here](/project/${ref}/database/column-privileges).`}
/>
</li>
</ul>
diff --git a/apps/studio/components/interfaces/Database/Publications/PublicationsList.tsx b/apps/studio/components/interfaces/Database/Publications/PublicationsList.tsx
index f527c5de428..807bdc2009d 100644
--- a/apps/studio/components/interfaces/Database/Publications/PublicationsList.tsx
+++ b/apps/studio/components/interfaces/Database/Publications/PublicationsList.tsx
@@ -2,7 +2,7 @@ import { PermissionAction } from '@supabase/shared-types/out/constants'
import { noop } from 'lodash'
import { useState } from 'react'
import toast from 'react-hot-toast'
-import { Button, IconAlertCircle, IconSearch, Input, Modal, Toggle } from 'ui'
+import { Button, IconAlertCircle, IconSearch, Input, Toggle } from 'ui'
import ConfirmationModal from 'ui-patterns/Dialogs/ConfirmationModal'
import { useProjectContext } from 'components/layouts/ProjectLayout/ProjectContext'
@@ -91,7 +91,7 @@ const PublicationsList = ({ onSelectPublication = noop }: PublicationsListProps)
<div className="w-[500px]">
<InformationBox
icon={<IconAlertCircle className="text-foreground-light" strokeWidth={2} />}
- title="You need additional permissions to update database replications"
+ title="You need additional permissions to update database publications"
/>
</div>
)}
diff --git a/apps/studio/components/interfaces/Organization/TeamSettings/RolesHelperModal/RolesHelperModal.constants.ts b/apps/studio/components/interfaces/Organization/TeamSettings/RolesHelperModal/RolesHelperModal.constants.ts
index 5ed8b2d051f..6f2a5189fe9 100644
--- a/apps/studio/components/interfaces/Organization/TeamSettings/RolesHelperModal/RolesHelperModal.constants.ts
+++ b/apps/studio/components/interfaces/Organization/TeamSettings/RolesHelperModal/RolesHelperModal.constants.ts
@@ -456,7 +456,7 @@ const DATABASE_PERMISSIONS = {
},
},
{
- description: 'Can read database replications',
+ description: 'Can read database publications',
permissions: {
owner: true,
admin: true,
@@ -466,7 +466,7 @@ const DATABASE_PERMISSIONS = {
},
},
{
- description: 'Can update database replications',
+ description: 'Can update database publications',
permissions: {
owner: true,
admin: true,
diff --git a/apps/studio/components/interfaces/Realtime/Inspector/MessagesTable.tsx b/apps/studio/components/interfaces/Realtime/Inspector/MessagesTable.tsx
index 3078c96e5f2..11e493aebf4 100644
--- a/apps/studio/components/interfaces/Realtime/Inspector/MessagesTable.tsx
+++ b/apps/studio/components/interfaces/Realtime/Inspector/MessagesTable.tsx
@@ -73,9 +73,9 @@ const NoResultAlert = ({
<p className="text-foreground">Listen to a table for changes</p>
<p className="text-foreground-lighter text-xs">Tables must have realtime enabled</p>
</div>
- <Link href={`/project/${ref}/database/replication`} target="_blank" rel="noreferrer">
+ <Link href={`/project/${ref}/database/publications`} target="_blank" rel="noreferrer">
<Button type="default" iconRight={<IconExternalLink />}>
- Replication settings
+ Publications settings
</Button>
</Link>
</div>
diff --git a/apps/studio/components/interfaces/TableGridEditor/GridHeaderActions.tsx b/apps/studio/components/interfaces/TableGridEditor/GridHeaderActions.tsx
index 14204939c98..c9564ac693f 100644
--- a/apps/studio/components/interfaces/TableGridEditor/GridHeaderActions.tsx
+++ b/apps/studio/components/interfaces/TableGridEditor/GridHeaderActions.tsx
@@ -6,19 +6,19 @@ import { Lock, MousePointer2, PlusCircle } from 'lucide-react'
import Link from 'next/link'
import { useState } from 'react'
import toast from 'react-hot-toast'
-import { Button, Modal, PopoverContent_Shadcn_, PopoverTrigger_Shadcn_, Popover_Shadcn_ } from 'ui'
+import { Button, PopoverContent_Shadcn_, PopoverTrigger_Shadcn_, Popover_Shadcn_ } from 'ui'
import { useProjectContext } from 'components/layouts/ProjectLayout/ProjectContext'
import APIDocsButton from 'components/ui/APIDocsButton'
-import ConfirmationModal from 'ui-patterns/Dialogs/ConfirmationModal'
-import ConfirmModal from 'ui-patterns/Dialogs/ConfirmDialog'
import { useDatabasePoliciesQuery } from 'data/database-policies/database-policies-query'
import { useDatabasePublicationsQuery } from 'data/database-publications/database-publications-query'
import { useDatabasePublicationUpdateMutation } from 'data/database-publications/database-publications-update-mutation'
import { useTableUpdateMutation } from 'data/tables/table-update-mutation'
import { useCheckPermissions, useIsFeatureEnabled } from 'hooks'
-import { RoleImpersonationPopover } from '../RoleImpersonationSelector'
import { EXCLUDED_SCHEMAS } from 'lib/constants/schemas'
+import ConfirmModal from 'ui-patterns/Dialogs/ConfirmDialog'
+import ConfirmationModal from 'ui-patterns/Dialogs/ConfirmationModal'
+import { RoleImpersonationPopover } from '../RoleImpersonationSelector'
export interface GridHeaderActionsProps {
table: PostgresTable
@@ -284,8 +284,8 @@ const GridHeaderActions = ({ table, isViewSelected, isTableSelected }: GridHeade
{!isRealtimeEnabled && (
<p className="text-sm">
You may also select which events to broadcast to subscribers on the{' '}
- <Link href={`/project/${ref}/database/replication`} className="text-brand">
- database replication
+ <Link href={`/project/${ref}/database/publications`} className="text-brand">
+ database publications
</Link>{' '}
settings.
</p>
diff --git a/apps/studio/components/layouts/AuthLayout/AuthLayout.tsx b/apps/studio/components/layouts/AuthLayout/AuthLayout.tsx
index 8c05659a12b..888cd787cfd 100644
--- a/apps/studio/components/layouts/AuthLayout/AuthLayout.tsx
+++ b/apps/studio/components/layouts/AuthLayout/AuthLayout.tsx
@@ -6,6 +6,8 @@ import { useIsColumnLevelPrivilegesEnabled } from 'components/interfaces/App/Fea
import { ProductMenu } from 'components/ui/ProductMenu'
import { useAuthConfigPrefetch } from 'data/auth/auth-config-query'
import { withAuth } from 'hooks'
+import Link from 'next/link'
+import { AlertDescription_Shadcn_, AlertTitle_Shadcn_, Alert_Shadcn_, Button } from 'ui'
import { ProjectLayout } from '../'
import { generateAuthMenu } from './AuthLayout.utils'
@@ -13,7 +15,7 @@ export interface AuthLayoutProps {
title?: string
}
-const AuthLayout = ({ title, children }: PropsWithChildren<AuthLayoutProps>) => {
+const AuthProductMenu = () => {
const { ref: projectRef = 'default' } = useParams()
const columnLevelPrivileges = useIsColumnLevelPrivilegesEnabled()
@@ -22,16 +24,36 @@ const AuthLayout = ({ title, children }: PropsWithChildren<AuthLayoutProps>) =>
const router = useRouter()
const page = router.pathname.split('/')[4]
+ return (
+ <>
+ <ProductMenu page={page} menu={generateAuthMenu(projectRef)} />
+ {columnLevelPrivileges && (
+ <div className="px-3">
+ <Alert_Shadcn_>
+ <AlertTitle_Shadcn_ className="text-sm">
+ Column Privileges has been shifted
+ </AlertTitle_Shadcn_>
+ <AlertDescription_Shadcn_ className="text-xs">
+ <p className="mb-2">It can now be found in the menu under the database section.</p>
+ <Button asChild type="default" size="tiny">
+ <Link href={`/project/${projectRef}/database/column-privileges`}>
+ Head over to Database
+ </Link>
+ </Button>
+ </AlertDescription_Shadcn_>
+ </Alert_Shadcn_>
+ </div>
+ )}
+ </>
+ )
+}
+
+const AuthLayout = ({ title, children }: PropsWithChildren<AuthLayoutProps>) => {
return (
<ProjectLayout
title={title || 'Authentication'}
product="Authentication"
- productMenu={
- <ProductMenu
- page={page}
- menu={generateAuthMenu(projectRef ?? 'default', { columnLevelPrivileges })}
- />
- }
+ productMenu={<AuthProductMenu />}
isBlocking={false}
>
<main style={{ maxHeight: '100vh' }} className="flex-1 overflow-y-auto">
diff --git a/apps/studio/components/layouts/AuthLayout/AuthLayout.utils.ts b/apps/studio/components/layouts/AuthLayout/AuthLayout.utils.ts
index bbdf9edad7e..731fba6a04a 100644
--- a/apps/studio/components/layouts/AuthLayout/AuthLayout.utils.ts
+++ b/apps/studio/components/layouts/AuthLayout/AuthLayout.utils.ts
@@ -1,10 +1,7 @@
import type { ProductMenuGroup } from 'components/ui/ProductMenu/ProductMenu.types'
import { IS_PLATFORM } from 'lib/constants'
-export const generateAuthMenu = (
- ref: string,
- options: { columnLevelPrivileges?: boolean } = {}
-): ProductMenuGroup[] => {
+export const generateAuthMenu = (ref: string): ProductMenuGroup[] => {
return [
{
title: 'Manage',
@@ -19,17 +16,6 @@ export const generateAuthMenu = (
url: `/project/${ref}/auth/policies`,
items: [],
},
- ...(options?.columnLevelPrivileges
- ? [
- {
- name: 'Column Privileges',
- key: 'column-privileges',
- url: `/project/${ref}/auth/column-privileges`,
- items: [],
- label: 'ALPHA',
- },
- ]
- : []),
...(IS_PLATFORM
? [
{
diff --git a/apps/studio/components/layouts/DatabaseLayout/DatabaseLayout.tsx b/apps/studio/components/layouts/DatabaseLayout/DatabaseLayout.tsx
index 735ebbaba78..019e7932833 100644
--- a/apps/studio/components/layouts/DatabaseLayout/DatabaseLayout.tsx
+++ b/apps/studio/components/layouts/DatabaseLayout/DatabaseLayout.tsx
@@ -1,10 +1,13 @@
import { useRouter } from 'next/router'
import { PropsWithChildren } from 'react'
+import { useIsColumnLevelPrivilegesEnabled } from 'components/interfaces/App/FeaturePreview/FeaturePreviewContext'
import { ProductMenu } from 'components/ui/ProductMenu'
import { useDatabaseExtensionsQuery } from 'data/database-extensions/database-extensions-query'
import { useProjectAddonsQuery } from 'data/subscriptions/project-addons-query'
import { useSelectedProject, withAuth } from 'hooks'
+import Link from 'next/link'
+import { AlertDescription_Shadcn_, AlertTitle_Shadcn_, Alert_Shadcn_ } from 'ui'
import { ProjectLayout } from '../'
import { generateDatabaseMenu } from './DatabaseMenu.utils'
@@ -12,7 +15,7 @@ export interface DatabaseLayoutProps {
title?: string
}
-const DatabaseLayout = ({ children }: PropsWithChildren<DatabaseLayoutProps>) => {
+const DatabaseProductMenu = () => {
const project = useSelectedProject()
const router = useRouter()
@@ -26,18 +29,40 @@ const DatabaseLayout = ({ children }: PropsWithChildren<DatabaseLayoutProps>) =>
const pgNetExtensionExists = (data ?? []).find((ext) => ext.name === 'pg_net') !== undefined
const pitrEnabled = addons?.selected_addons.find((addon) => addon.type === 'pitr') !== undefined
+ const columnLevelPrivileges = useIsColumnLevelPrivilegesEnabled()
+
+ return (
+ <>
+ <ProductMenu
+ page={page}
+ menu={generateDatabaseMenu(project, {
+ pgNetExtensionExists,
+ pitrEnabled,
+ columnLevelPrivileges,
+ })}
+ />
+ <div className="px-3">
+ <Alert_Shadcn_>
+ <AlertTitle_Shadcn_ className="text-sm">
+ Replication section has been renamed
+ </AlertTitle_Shadcn_>
+ <AlertDescription_Shadcn_ className="text-xs">
+ <p className="mb-2">
+ It can be now found under{' '}
+ <Link href={`/project/${project?.ref}/database/publications`} className="underline">
+ Publications
+ </Link>
+ </p>
+ </AlertDescription_Shadcn_>
+ </Alert_Shadcn_>
+ </div>
+ </>
+ )
+}
+const DatabaseLayout = ({ children }: PropsWithChildren<DatabaseLayoutProps>) => {
return (
- <ProjectLayout
- product="Database"
- productMenu={
- <ProductMenu
- page={page}
- menu={generateDatabaseMenu(project, { pgNetExtensionExists, pitrEnabled })}
- />
- }
- isBlocking={false}
- >
+ <ProjectLayout product="Database" productMenu={<DatabaseProductMenu />} isBlocking={false}>
<main style={{ maxHeight: '100vh' }} className="flex-1 overflow-y-auto">
{children}
</main>
diff --git a/apps/studio/components/layouts/DatabaseLayout/DatabaseMenu.utils.ts b/apps/studio/components/layouts/DatabaseLayout/DatabaseMenu.utils.tsx
similarity index 71%
rename from apps/studio/components/layouts/DatabaseLayout/DatabaseMenu.utils.ts
rename to apps/studio/components/layouts/DatabaseLayout/DatabaseMenu.utils.tsx
index 26af4befb0d..668f20bb770 100644
--- a/apps/studio/components/layouts/DatabaseLayout/DatabaseMenu.utils.ts
+++ b/apps/studio/components/layouts/DatabaseLayout/DatabaseMenu.utils.tsx
@@ -1,23 +1,28 @@
import type { ProductMenuGroup } from 'components/ui/ProductMenu/ProductMenu.types'
import type { Project } from 'data/projects/project-detail-query'
import { IS_PLATFORM } from 'lib/constants'
+import { ArrowUpRight } from 'lucide-react'
export const generateDatabaseMenu = (
project?: Project,
- flags?: { pgNetExtensionExists: boolean; pitrEnabled: boolean }
+ flags?: {
+ pgNetExtensionExists: boolean
+ pitrEnabled: boolean
+ columnLevelPrivileges: boolean
+ }
): ProductMenuGroup[] => {
const ref = project?.ref ?? 'default'
- const { pgNetExtensionExists, pitrEnabled } = flags || {}
+ const { pgNetExtensionExists, pitrEnabled, columnLevelPrivileges } = flags || {}
return [
{
- title: 'Database',
+ title: 'Database Management',
items: [
{ name: 'Tables', key: 'tables', url: `/project/${ref}/database/tables`, items: [] },
{
- name: 'Schema Visualizer',
- key: 'schemas',
- url: `/project/${ref}/database/schemas`,
+ name: 'Functions',
+ key: 'functions',
+ url: `/project/${ref}/database/functions`,
items: [],
},
{
@@ -27,9 +32,10 @@ export const generateDatabaseMenu = (
items: [],
},
{
- name: 'Functions',
- key: 'functions',
- url: `/project/${ref}/database/functions`,
+ name: 'Enumerated Types',
+ key: 'types',
+ url: `/project/${ref}/database/types`,
+
items: [],
},
{
@@ -38,29 +44,47 @@ export const generateDatabaseMenu = (
url: `/project/${ref}/database/extensions`,
items: [],
},
- { name: 'Roles', key: 'roles', url: `/project/${ref}/database/roles`, items: [] },
{
- name: 'Replication',
- key: 'replication',
- url: `/project/${ref}/database/replication`,
+ name: 'Indexes',
+ key: 'indexes',
+ url: `/project/${ref}/database/indexes`,
+ items: [],
+ },
+ {
+ name: 'Publications',
+ key: 'publications',
+ url: `/project/${ref}/database/publications`,
items: [],
},
- ...(!!pgNetExtensionExists
+ ],
+ },
+ {
+ title: 'Access Control',
+ items: [
+ { name: 'Roles', key: 'roles', url: `/project/${ref}/database/roles`, items: [] },
+ ...(columnLevelPrivileges
? [
{
- name: 'Webhooks',
- key: 'hooks',
- url: `/project/${ref}/database/hooks`,
+ name: 'Column Privileges',
+ key: 'column-privileges',
+ url: `/project/${ref}/database/column-privileges`,
items: [],
+ label: 'ALPHA',
},
]
: []),
{
- name: 'Wrappers',
- key: 'wrappers',
- url: `/project/${ref}/database/wrappers`,
+ name: 'Policies',
+ key: 'policies',
+ url: `/project/${ref}/auth/policies`,
+ rightIcon: <ArrowUpRight strokeWidth={1} className="h-4 w-4" />,
items: [],
},
+ ],
+ },
+ {
+ title: 'Platform',
+ items: [
...(IS_PLATFORM
? [
{
@@ -74,21 +98,36 @@ export const generateDatabaseMenu = (
]
: []),
{
- name: 'Migrations',
- key: 'migrations',
- url: `/project/${ref}/database/migrations`,
+ name: 'Wrappers',
+ key: 'wrappers',
+ url: `/project/${ref}/database/wrappers`,
items: [],
},
{
- name: 'Indexes',
- key: 'indexes',
- url: `/project/${ref}/database/indexes`,
+ name: 'Migrations',
+ key: 'migrations',
+ url: `/project/${ref}/database/migrations`,
items: [],
},
+ ...(!!pgNetExtensionExists
+ ? [
+ {
+ name: 'Webhooks',
+ key: 'hooks',
+ url: `/project/${ref}/database/hooks`,
+ items: [],
+ },
+ ]
+ : []),
+ ],
+ },
+ {
+ title: 'Tools',
+ items: [
{
- name: 'Enumerated Types',
- key: 'types',
- url: `/project/${ref}/database/types`,
+ name: 'Schema Visualizer',
+ key: 'schemas',
+ url: `/project/${ref}/database/schemas`,
items: [],
},
{
diff --git a/apps/studio/components/ui/ProductMenu/ProductMenu.tsx b/apps/studio/components/ui/ProductMenu/ProductMenu.tsx
index 69665dbab62..e36d36add1f 100644
--- a/apps/studio/components/ui/ProductMenu/ProductMenu.tsx
+++ b/apps/studio/components/ui/ProductMenu/ProductMenu.tsx
@@ -34,6 +34,7 @@ const ProductMenu = ({ page, menu }: ProductMenuProps) => {
url={item.url}
name={item.name}
icon={item.icon}
+ rightIcon={item.rightIcon}
isActive={page === item.key}
isExternal={item.isExternal}
target={item.isExternal ? '_blank' : '_self'}
diff --git a/apps/studio/components/ui/ProductMenu/ProductMenu.types.ts b/apps/studio/components/ui/ProductMenu/ProductMenu.types.ts
index d91295eef8a..d0a6d31523b 100644
--- a/apps/studio/components/ui/ProductMenu/ProductMenu.types.ts
+++ b/apps/studio/components/ui/ProductMenu/ProductMenu.types.ts
@@ -13,6 +13,7 @@ export interface ProductMenuGroupItem {
url: string
items: any[]
icon?: ReactNode
+ rightIcon?: ReactNode
isExternal?: boolean
disabled?: boolean
label?: string
diff --git a/apps/studio/components/ui/ProductMenu/ProductMenuItem.tsx b/apps/studio/components/ui/ProductMenu/ProductMenuItem.tsx
index b5843ec5bfa..5441340bb8d 100644
--- a/apps/studio/components/ui/ProductMenu/ProductMenuItem.tsx
+++ b/apps/studio/components/ui/ProductMenu/ProductMenuItem.tsx
@@ -7,6 +7,7 @@ interface ProductMenuItemProps {
isActive: boolean
isExternal?: boolean
icon?: ReactNode
+ rightIcon?: ReactNode
url?: string
target?: '_blank' | '_self'
onClick?: () => void
@@ -20,6 +21,7 @@ const ProductMenuItem = ({
isActive,
isExternal,
icon,
+ rightIcon,
url = '',
target = '_self',
onClick,
@@ -37,6 +39,7 @@ const ProductMenuItem = ({
<span className="truncate">{name} </span>
{label !== undefined && <Badge variant="warning">{label}</Badge>}
</div>
+ {rightIcon && <div>{rightIcon}</div>}
</div>
</Menu.Item>
)
diff --git a/apps/studio/next.config.js b/apps/studio/next.config.js
index 69929944471..e83f0d2c7a2 100644
--- a/apps/studio/next.config.js
+++ b/apps/studio/next.config.js
@@ -186,6 +186,11 @@ const nextConfig = {
destination: '/project/:ref/database/tables',
permanent: true,
},
+ {
+ source: '/project/:ref/database/replication',
+ destination: '/project/:ref/database/publications',
+ permanent: true,
+ },
{
source: '/project/:ref/database/graphiql',
destination: '/project/:ref/api/graphiql',
@@ -354,6 +359,11 @@ const nextConfig = {
source: '/project/:ref/reports/query-performance',
destination: '/project/:ref/database/query-performance',
},
+ {
+ permanent: true,
+ source: '/project/:ref/auth/column-privileges',
+ destination: '/project/:ref/database/column-privileges',
+ },
...(process.env.NEXT_PUBLIC_BASE_PATH?.length
? [
{
diff --git a/apps/studio/pages/project/[ref]/auth/column-privileges.tsx b/apps/studio/pages/project/[ref]/database/column-privileges.tsx
similarity index 98%
rename from apps/studio/pages/project/[ref]/auth/column-privileges.tsx
rename to apps/studio/pages/project/[ref]/database/column-privileges.tsx
index 40d8c3d0d7b..98372f0fed5 100644
--- a/apps/studio/pages/project/[ref]/auth/column-privileges.tsx
+++ b/apps/studio/pages/project/[ref]/database/column-privileges.tsx
@@ -1,4 +1,3 @@
-import type { PostgresRole } from '@supabase/postgres-meta'
import { useParams } from 'common'
import { XIcon } from 'lucide-react'
import Link from 'next/link'
@@ -23,7 +22,7 @@ import {
import PrivilegesHead from 'components/interfaces/Database/Privileges/PrivilegesHead'
import PrivilegesTable from 'components/interfaces/Database/Privileges/PrivilegesTable'
import ProtectedSchemaWarning from 'components/interfaces/Database/ProtectedSchemaWarning'
-import { AuthLayout } from 'components/layouts'
+import { DatabaseLayout } from 'components/layouts'
import { useProjectContext } from 'components/layouts/ProjectLayout/ProjectContext'
import { ScaffoldContainer, ScaffoldSection } from 'components/layouts/Scaffold'
import AlertError from 'components/ui/AlertError'
@@ -35,8 +34,8 @@ import { useTablesQuery } from 'data/tables/tables-query'
import { useLocalStorage } from 'hooks'
import { LOCAL_STORAGE_KEYS } from 'lib/constants'
import { EXCLUDED_SCHEMAS } from 'lib/constants/schemas'
-import type { NextPageWithLayout } from 'types'
import { useAppStateSnapshot } from 'state/app-state'
+import type { NextPageWithLayout } from 'types'
const EDITABLE_ROLES = ['authenticated', 'anon', 'service_role']
@@ -376,6 +375,8 @@ const PrivilegesPage: NextPageWithLayout = () => {
)
}
-PrivilegesPage.getLayout = (page) => <AuthLayout title="Column Privileges">{page}</AuthLayout>
+PrivilegesPage.getLayout = (page) => (
+ <DatabaseLayout title="Column Privileges">{page}</DatabaseLayout>
+)
export default PrivilegesPage
diff --git a/apps/studio/pages/project/[ref]/database/replication.tsx b/apps/studio/pages/project/[ref]/database/publications.tsx
similarity index 89%
rename from apps/studio/pages/project/[ref]/database/replication.tsx
rename to apps/studio/pages/project/[ref]/database/publications.tsx
index 5b4df2aa27d..0d886f93a16 100644
--- a/apps/studio/pages/project/[ref]/database/replication.tsx
+++ b/apps/studio/pages/project/[ref]/database/publications.tsx
@@ -5,17 +5,17 @@ import { PublicationsList, PublicationsTables } from 'components/interfaces/Data
import { DatabaseLayout } from 'components/layouts'
import { useProjectContext } from 'components/layouts/ProjectLayout/ProjectContext'
import { ScaffoldContainer, ScaffoldSection } from 'components/layouts/Scaffold'
+import { FormHeader } from 'components/ui/Forms'
import NoPermission from 'components/ui/NoPermission'
import { useDatabasePublicationsQuery } from 'data/database-publications/database-publications-query'
import { useCheckPermissions, usePermissionsLoaded } from 'hooks'
import type { NextPageWithLayout } from 'types'
-import { FormHeader } from 'components/ui/Forms'
// [Joshen] Technically, best that we have these as separate URLs
// makes it easier to manage state, but foresee that this page might
// be consolidated somewhere else eventually for better UX
-const DatabaseReplication: NextPageWithLayout = () => {
+const DatabasePublications: NextPageWithLayout = () => {
const { project } = useProjectContext()
const { data } = useDatabasePublicationsQuery({
@@ -41,7 +41,7 @@ const DatabaseReplication: NextPageWithLayout = () => {
<ScaffoldContainer>
<ScaffoldSection>
<div className="col-span-12">
- <FormHeader title="Database Replications" />
+ <FormHeader title="Database Publications" />
{selectedPublication === undefined ? (
<PublicationsList onSelectPublication={setSelectedPublicationId} />
) : (
@@ -56,6 +56,6 @@ const DatabaseReplication: NextPageWithLayout = () => {
)
}
-DatabaseReplication.getLayout = (page) => <DatabaseLayout title="Database">{page}</DatabaseLayout>
+DatabasePublications.getLayout = (page) => <DatabaseLayout title="Database">{page}</DatabaseLayout>
-export default DatabaseReplication
+export default DatabasePublications
diff --git a/apps/www/_blog/2022-11-17-fetching-and-caching-supabase-data-in-next-js-server-components.mdx b/apps/www/_blog/2022-11-17-fetching-and-caching-supabase-data-in-next-js-server-components.mdx
index d602494629d..9bdcd9d41a8 100644
--- a/apps/www/_blog/2022-11-17-fetching-and-caching-supabase-data-in-next-js-server-components.mdx
+++ b/apps/www/_blog/2022-11-17-fetching-and-caching-supabase-data-in-next-js-server-components.mdx
@@ -384,7 +384,7 @@ But now we have loading spinners! Yuck!
# Realtime
-Realtime allows us to subscribe to changes in Supabase — inserted, updated or deleted posts — and update our UI dynamically. In order to receive realtime events, we need to [enable replication](https://supabase.com/dashboard/project/_/database/replication) on the posts table.
+Realtime allows us to subscribe to changes in Supabase — inserted, updated or deleted posts — and update our UI dynamically. In order to receive realtime events, we need to [enable replication](https://supabase.com/dashboard/project/_/database/publications) on the posts table.
Let’s merge the two previous concepts and fetch the initial state of our posts in a Server Component, and then render a Client Component to do client-y things — like subscribe to changes in the DB and update the UI dynamically:
diff --git a/apps/www/_customers/shotgun.mdx b/apps/www/_customers/shotgun.mdx
index 6de69ab0c5a..f666300f759 100644
--- a/apps/www/_customers/shotgun.mdx
+++ b/apps/www/_customers/shotgun.mdx
@@ -61,7 +61,7 @@ With Supabase, they found instant savings on the instance pricing and then addit
The most significant change for Shotgun was the cost savings they achieved with Supabase. Instead of spending $12k per month, the team now spends $2,155 per month. An 83% decrease.
-Their database infrastructure bill went from $7k to a bit over $2k and Shotgun was able to turn off most of their Fivetran spend by taking advantage of the [replication features](https://supabase.com/docs/guides/database/replication) available in Supabase.
+Their database infrastructure bill went from $7k to a bit over $2k and Shotgun was able to turn off most of their Fivetran spend by taking advantage of the [publications features](https://supabase.com/docs/guides/database/replication) available in Supabase.
The migration itself also led to further performance gains. Helped by our Head of Customer Success, Kevin Brolly, they made a couple of Postgres configuration changes and smaller database optimizations. Now, the Shotgun team sees a 40% lower response time on calls to the database, which leads to less usage/consumption of the server, and even a lower bill on other providers such as Vercel as well.
diff --git a/packages/ui-patterns/Cmdk/utils/shared-nav-items.json b/packages/ui-patterns/Cmdk/utils/shared-nav-items.json
index 8537cd9aeda..26fe1efa544 100644
--- a/packages/ui-patterns/Cmdk/utils/shared-nav-items.json
+++ b/packages/ui-patterns/Cmdk/utils/shared-nav-items.json
@@ -32,9 +32,13 @@
"label": "Roles",
"url": "/project/_/database/roles"
},
+ {
+ "label": "Publications",
+ "url": "/project/_/database/publications"
+ },
{
"label": "Replication",
- "url": "/project/_/database/replication"
+ "url": "/project/_/database/publications"
},
{
"label": "Webhooks",