Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1849,6 +1849,10 @@ export const realtime: NavMenuConstant = {
name: 'Guides',
url: undefined,
items: [
{
name: 'Realtime Reports',
url: '/guides/realtime/reports' as `/${string}`,
},
{
name: 'Subscribing to Database Changes',
url: '/guides/realtime/subscribing-to-database-changes' as `/${string}`,
Expand Down
369 changes: 369 additions & 0 deletions apps/docs/content/guides/realtime/reports.mdx

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,11 @@ export const BackupItem = ({ index, isHealthy, backup, onSelectBackup }: BackupI
<Badge variant="default">{backup.isPhysicalBackup ? 'Physical' : 'Logical'}</Badge>
</TooltipTrigger>
<TooltipContent side="bottom">
Learn more about backup types{' '}
{backup.isPhysicalBackup
? 'File-level backups of your entire database.'
: 'SQL-based backups of your entire database.'}{' '}
<InlineLink href="https://supabase.com/blog/postgresql-physical-logical-backups">
here
Learn more
</InlineLink>
</TooltipContent>
</Tooltip>
Expand Down
40 changes: 25 additions & 15 deletions apps/studio/components/interfaces/Database/Backups/BackupsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { useSetProjectStatus } from 'data/projects/project-detail-query'
import { useCheckEntitlements } from 'hooks/misc/useCheckEntitlements'
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
import { PROJECT_STATUS } from 'lib/constants'
import { Admonition } from 'ui-patterns/admonition'
import ConfirmationModal from 'ui-patterns/Dialogs/ConfirmationModal'
import { BackupItem } from './BackupItem'
import { BackupsEmpty } from './BackupsEmpty'
Expand Down Expand Up @@ -95,17 +96,12 @@ export const BackupsList = () => {
)}
</div>
<ConfirmationModal
size="medium"
confirmLabel="Confirm restore"
confirmLabelLoading="Restoring"
size="small"
confirmLabel="Restore"
confirmLabelLoading="Restoring..."
variant="warning"
visible={selectedBackup !== undefined}
title="Confirm to restore from backup"
alert={{
base: { variant: 'warning' },
title: 'Your project will be offline while the restore is in progress',
description:
'It is advised to upgrade at a time when there will be minimal impact for your application.',
}}
title="Restore from backup"
loading={isRestoring || isSuccessBackup}
onCancel={() => setSelectedBackup(undefined)}
onConfirm={() => {
Expand All @@ -114,11 +110,25 @@ export const BackupsList = () => {
restoreFromBackup({ ref: projectRef, backup: selectedBackup })
}}
>
<p className="text-sm">
Are you sure you want to restore from{' '}
{dayjs(selectedBackup?.inserted_at).format('DD MMM YYYY')}? This will destroy any new data
written since this backup was made.
</p>
<div className="space-y-3">
<p className="text-sm">
This will restore your database to the backup made on{' '}
{dayjs(selectedBackup?.inserted_at).format('DD MMM YYYY')} at{' '}
{dayjs(selectedBackup?.inserted_at).format('HH:mm:ss')} UTC.
</p>

<Admonition
showIcon={false}
type="warning"
title="This action cannot be undone"
description={
<ul className="list-disc list-inside">
<li>Your project will be offline during restoration</li>
<li>Any new data since this backup will be lost</li>
</ul>
}
/>
</div>
</ConfirmationModal>
</>
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { AlertDescription_Shadcn_, Alert_Shadcn_, WarningIcon } from 'ui'
import { Admonition } from 'ui-patterns/admonition'

export const BackupsStorageAlert = () => {
return (
<Alert_Shadcn_ variant="default">
<WarningIcon />
<AlertDescription_Shadcn_>
Database backups do not include objects stored via the Storage API, as the database only
<Admonition
type="default"
layout="horizontal"
title="Storage objects are not included"
description="Database backups do not include objects stored via the Storage API, as the database only
includes metadata about these objects. Restoring an old backup does not restore objects that
have been deleted since then.
</AlertDescription_Shadcn_>
</Alert_Shadcn_>
have been deleted since then."
/>
)
}
15 changes: 11 additions & 4 deletions apps/studio/components/layouts/ProjectLayout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,14 @@ export const ProjectLayout = forwardRef<HTMLDivElement, PropsWithChildren<Projec
? selectedProject.status === PROJECT_STATUS.ACTIVE_HEALTHY ||
(selectedProject.status === PROJECT_STATUS.COMING_UP &&
router.pathname.includes('/project/[ref]/settings')) ||
router.pathname.includes('/project/[ref]/branches')
router.pathname.includes('/project/[ref]/branches') ||
router.pathname.includes('/project/[ref]/functions')
: true

const ignorePausedState =
router.pathname === '/project/[ref]' || router.pathname.includes('/project/[ref]/settings')
router.pathname === '/project/[ref]' ||
router.pathname.includes('/project/[ref]/settings') ||
router.pathname.includes('/project/[ref]/functions')
const showPausedState = isPaused && !ignorePausedState

const sidebarMinSizePercentage = 1
Expand Down Expand Up @@ -280,12 +283,16 @@ const ContentWrapper = ({ isLoading, isBlocking = true, children }: ContentWrapp

const isBranchesPage = router.pathname.includes('/project/[ref]/branches')
const isSettingsPages = router.pathname.includes('/project/[ref]/settings')
const isEdgeFunctionPages = router.pathname.includes('/project/[ref]/functions')
const isVaultPage = router.pathname === '/project/[ref]/settings/vault'
const isBackupsPage = router.pathname.includes('/project/[ref]/database/backups')
const isHomePage = router.pathname === '/project/[ref]'

const requiresDbConnection: boolean =
(!isSettingsPages && !routesToIgnoreDBConnection.includes(router.pathname)) || isVaultPage
(!isEdgeFunctionPages &&
!isSettingsPages &&
!routesToIgnoreDBConnection.includes(router.pathname)) ||
isVaultPage
const requiresPostgrestConnection = !routesToIgnorePostgrestConnection.includes(router.pathname)
const requiresProjectDetails = !routesToIgnoreProjectDetailsRequest.includes(router.pathname)

Expand Down Expand Up @@ -351,7 +358,7 @@ const ContentWrapper = ({ isLoading, isBlocking = true, children }: ContentWrapp
return <RestoringState />
}

if (isProjectRestoreFailed && !isBackupsPage) {
if (isProjectRestoreFailed && !isBackupsPage && !isEdgeFunctionPages) {
return <RestoreFailedState />
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const DatabaseScheduledBackups: NextPageWithLayout = () => {
<>
{!isPitrEnabled && (
<p className="text-sm text-foreground-light">
Projects are backed up daily around midnight of your project's region and
Projects are backed up daily around midnight of your projects region and
can be restored at any time.
</p>
)}
Expand Down
2 changes: 1 addition & 1 deletion apps/www/_blog/2020-07-09-postgresql-templates.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ categories:
tags:
- postgres
- planetpg
date: '07-09-2020'
date: '2020-07-09'
---

Whenever you create a new database in Postgres, you are actually [basing it off an already present database](https://www.postgresql.org/docs/current/manage-ag-templatedbs.html) in your cluster.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ categories:
tags:
- postgres
- planetpg
date: '07-07-2020'
date: '2020-07-07'
---

PostgreSQL backups can be categorized into two types: _logical_ and _physical_. This post briefly covers each type and discusses the situations where you would use either one.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ categories:
tags:
- postgres
- planetpg
date: '08-02-2020'
date: '2020-08-02'
---

Have you ever wanted to restore your database's state to a particular moment in time? This post explains how, using WAL-G.
Expand Down
1 change: 1 addition & 0 deletions supa-mdx-lint/Rule003Spelling.toml
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ allow_list = [
"Thanos",
"TimescaleDB",
"tmux",
"TooManyChannels",
"Transformers.js",
"tsquery",
"Twilio",
Expand Down
Loading