-
+
)
diff --git a/apps/studio/components/interfaces/Realtime/Inspector/RealtimeFilterPopover/index.tsx b/apps/studio/components/interfaces/Realtime/Inspector/RealtimeFilterPopover/index.tsx
index 55f0fd2a56..1e5ac85c02 100644
--- a/apps/studio/components/interfaces/Realtime/Inspector/RealtimeFilterPopover/index.tsx
+++ b/apps/studio/components/interfaces/Realtime/Inspector/RealtimeFilterPopover/index.tsx
@@ -5,6 +5,7 @@ import { Dispatch, SetStateAction, useState } from 'react'
import { useParams } from 'common'
import { useSendEventMutation } from 'data/telemetry/send-event-mutation'
import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization'
+import { DOCS_URL } from 'lib/constants'
import {
Badge,
Button,
@@ -180,7 +181,7 @@ export const RealtimeFilterPopover = ({ config, onChangeConfig }: RealtimeFilter
className="underline"
target="_blank"
rel="noreferrer"
- href="https://supabase.com/docs/guides/realtime/postgres-changes#available-filters"
+ href={`${DOCS_URL}/guides/realtime/postgres-changes#available-filters`}
>
our docs
diff --git a/apps/studio/components/interfaces/RoleImpersonationSelector/UserImpersonationSelector.tsx b/apps/studio/components/interfaces/RoleImpersonationSelector/UserImpersonationSelector.tsx
index befa9621cf..139998920e 100644
--- a/apps/studio/components/interfaces/RoleImpersonationSelector/UserImpersonationSelector.tsx
+++ b/apps/studio/components/interfaces/RoleImpersonationSelector/UserImpersonationSelector.tsx
@@ -10,6 +10,7 @@ import { User, useUsersInfiniteQuery } from 'data/auth/users-infinite-query'
import { useCustomAccessTokenHookDetails } from 'hooks/misc/useCustomAccessTokenHookDetails'
import { useLocalStorage } from 'hooks/misc/useLocalStorage'
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
+import { DOCS_URL } from 'lib/constants'
import { useRoleImpersonationStateSnapshot } from 'state/role-impersonation-state'
import { ResponseError } from 'types'
import {
@@ -393,10 +394,7 @@ const UserImpersonationSelector = () => {
AAL1 verifies users via standard login methods, while AAL2 adds a second
authentication factor. If you're not using MFA, you can leave this on AAL1.
Learn more about MFA{' '}
-
- here
-
- .
+ here.
diff --git a/apps/studio/components/interfaces/SQLEditor/DownloadSnippetModal.tsx b/apps/studio/components/interfaces/SQLEditor/DownloadSnippetModal.tsx
index 935e6d6c9c..c531a7df6e 100644
--- a/apps/studio/components/interfaces/SQLEditor/DownloadSnippetModal.tsx
+++ b/apps/studio/components/interfaces/SQLEditor/DownloadSnippetModal.tsx
@@ -5,6 +5,7 @@ import { useState } from 'react'
import type { ModalProps } from '@ui/components/Modal/Modal'
import TwoOptionToggle from 'components/ui/TwoOptionToggle'
+import { DOCS_URL } from 'lib/constants'
import { useSqlEditorV2StateSnapshot } from 'state/sql-editor-v2'
import { Button, CodeBlock, Modal, Tabs } from 'ui'
import { Markdown } from '../Markdown'
@@ -104,7 +105,7 @@ const DownloadSnippetModal = ({ id, ...props }: DownloadSnippetModalProps) => {
}>
@@ -114,7 +115,7 @@ const DownloadSnippetModal = ({ id, ...props }: DownloadSnippetModalProps) => {
}>
diff --git a/apps/studio/components/interfaces/SQLEditor/SQLEditor.queries.ts b/apps/studio/components/interfaces/SQLEditor/SQLEditor.queries.ts
index 2913b1a5cd..7c7c189579 100644
--- a/apps/studio/components/interfaces/SQLEditor/SQLEditor.queries.ts
+++ b/apps/studio/components/interfaces/SQLEditor/SQLEditor.queries.ts
@@ -1,3 +1,4 @@
+import { DOCS_URL } from 'lib/constants'
import type { SQLTemplate } from './SQLEditor.types'
export const SQL_TEMPLATES: SQLTemplate[] = [
@@ -901,7 +902,7 @@ create table profiles (
constraint username_length check (char_length(username) >= 3)
);
-- Set up Row Level Security (RLS)
--- See https://supabase.com/docs/guides/auth/row-level-security for more details.
+-- See ${DOCS_URL}/guides/auth/row-level-security for more details.
alter table profiles
enable row level security;
@@ -915,7 +916,7 @@ create policy "Users can update own profile." on profiles
for update using ((select auth.uid()) = id);
-- This trigger automatically creates a profile entry when a new user signs up via Supabase Auth.
--- See https://supabase.com/docs/guides/auth/managing-user-data#using-triggers for more details.
+-- See ${DOCS_URL}/guides/auth/managing-user-data#using-triggers for more details.
create function public.handle_new_user()
returns trigger
set search_path = ''
@@ -935,7 +936,7 @@ insert into storage.buckets (id, name)
values ('avatars', 'avatars');
-- Set up access controls for storage.
--- See https://supabase.com/docs/guides/storage#policy-examples for more details.
+-- See ${DOCS_URL}/guides/storage#policy-examples for more details.
create policy "Avatar images are publicly accessible." on storage.objects
for select using (bucket_id = 'avatars');
diff --git a/apps/studio/components/interfaces/SQLEditor/UtilityPanel/UtilityTabResults.tsx b/apps/studio/components/interfaces/SQLEditor/UtilityPanel/UtilityTabResults.tsx
index 12fc1bc9c6..7b52fd4763 100644
--- a/apps/studio/components/interfaces/SQLEditor/UtilityPanel/UtilityTabResults.tsx
+++ b/apps/studio/components/interfaces/SQLEditor/UtilityPanel/UtilityTabResults.tsx
@@ -9,6 +9,7 @@ import { InlineLink, InlineLinkClassName } from 'components/ui/InlineLink'
import { useProjectSettingsV2Query } from 'data/config/project-settings-v2-query'
import { useOrgSubscriptionQuery } from 'data/subscriptions/org-subscription-query'
import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization'
+import { DOCS_URL } from 'lib/constants'
import { useDatabaseSelectorStateSnapshot } from 'state/database-selector'
import { useSqlEditorV2StateSnapshot } from 'state/sql-editor-v2'
import { AiIconAnimation, Button, cn, Tooltip, TooltipContent, TooltipTrigger } from 'ui'
@@ -72,11 +73,13 @@ const UtilityTabResults = forwardRef(
You can either{' '}
-
+
optimize your query
, or{' '}
-
+
increase the statement timeout
{' or '}
diff --git a/apps/studio/components/interfaces/Settings/API/HardenAPIModal.tsx b/apps/studio/components/interfaces/Settings/API/HardenAPIModal.tsx
index dee54c4380..07c06f3da2 100644
--- a/apps/studio/components/interfaces/Settings/API/HardenAPIModal.tsx
+++ b/apps/studio/components/interfaces/Settings/API/HardenAPIModal.tsx
@@ -9,6 +9,7 @@ import { useProjectPostgrestConfigQuery } from 'data/config/project-postgrest-co
import { useProjectPostgrestConfigUpdateMutation } from 'data/config/project-postgrest-config-update-mutation'
import { useSchemasQuery } from 'data/database/schemas-query'
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
+import { DOCS_URL } from 'lib/constants'
import {
AlertDescription_Shadcn_,
AlertTitle_Shadcn_,
@@ -122,7 +123,7 @@ export const HardenAPIModal = ({ visible, onClose }: HardenAPIModalProps) => {
diff --git a/apps/studio/components/interfaces/Settings/API/PostgrestConfig.tsx b/apps/studio/components/interfaces/Settings/API/PostgrestConfig.tsx
index 5f2e97cc07..33fddb3c71 100644
--- a/apps/studio/components/interfaces/Settings/API/PostgrestConfig.tsx
+++ b/apps/studio/components/interfaces/Settings/API/PostgrestConfig.tsx
@@ -17,6 +17,7 @@ import { useDatabaseExtensionsQuery } from 'data/database-extensions/database-ex
import { useSchemasQuery } from 'data/database/schemas-query'
import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
+import { DOCS_URL } from 'lib/constants'
import {
AlertDescription_Shadcn_,
AlertTitle_Shadcn_,
@@ -170,7 +171,7 @@ export const PostgrestConfig = () => {
Data API Settings
-
+ } onClick={() => setShowModal(true)}>
Harden Data API
diff --git a/apps/studio/components/interfaces/Settings/Addons/Addons.tsx b/apps/studio/components/interfaces/Settings/Addons/Addons.tsx
index 10bdd198f7..bb72a78db3 100644
--- a/apps/studio/components/interfaces/Settings/Addons/Addons.tsx
+++ b/apps/studio/components/interfaces/Settings/Addons/Addons.tsx
@@ -36,7 +36,7 @@ import {
useSelectedProjectQuery,
} from 'hooks/misc/useSelectedProject'
import { getCloudProviderArchitecture } from 'lib/cloudprovider-utils'
-import { BASE_PATH, INSTANCE_MICRO_SPECS, INSTANCE_NANO_SPECS } from 'lib/constants'
+import { BASE_PATH, DOCS_URL, INSTANCE_MICRO_SPECS, INSTANCE_NANO_SPECS } from 'lib/constants'
import { getDatabaseMajorVersion, getSemanticVersion } from 'lib/helpers'
import { useAddonsPagePanel } from 'state/addons-page'
import { Alert, AlertDescription_Shadcn_, AlertTitle_Shadcn_, Alert_Shadcn_, Button } from 'ui'
@@ -180,7 +180,7 @@ export const Addons = () => {
More information
@@ -192,7 +192,7 @@ export const Addons = () => {
@@ -347,7 +347,7 @@ export const Addons = () => {
More information
@@ -424,7 +424,7 @@ export const Addons = () => {
More information
@@ -548,7 +548,7 @@ export const Addons = () => {
More information
diff --git a/apps/studio/components/interfaces/Settings/Addons/CustomDomainSidePanel.tsx b/apps/studio/components/interfaces/Settings/Addons/CustomDomainSidePanel.tsx
index 7e035c727b..e400dd79e8 100644
--- a/apps/studio/components/interfaces/Settings/Addons/CustomDomainSidePanel.tsx
+++ b/apps/studio/components/interfaces/Settings/Addons/CustomDomainSidePanel.tsx
@@ -11,6 +11,7 @@ import { useProjectAddonsQuery } from 'data/subscriptions/project-addons-query'
import type { AddonVariantId } from 'data/subscriptions/types'
import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'
import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization'
+import { DOCS_URL } from 'lib/constants'
import { formatCurrency } from 'lib/helpers'
import { useAddonsPagePanel } from 'state/addons-page'
import {
@@ -119,7 +120,7 @@ const CustomDomainSidePanel = () => {
Custom domains
}>
diff --git a/apps/studio/components/interfaces/Settings/Addons/IPv4SidePanel.tsx b/apps/studio/components/interfaces/Settings/Addons/IPv4SidePanel.tsx
index 01e54ff330..36d985268d 100644
--- a/apps/studio/components/interfaces/Settings/Addons/IPv4SidePanel.tsx
+++ b/apps/studio/components/interfaces/Settings/Addons/IPv4SidePanel.tsx
@@ -13,6 +13,7 @@ import type { AddonVariantId } from 'data/subscriptions/types'
import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'
import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization'
import { useIsAwsCloudProvider } from 'hooks/misc/useSelectedProject'
+import { DOCS_URL } from 'lib/constants'
import { formatCurrency } from 'lib/helpers'
import { useAddonsPagePanel } from 'state/addons-page'
import { Button, Radio, SidePanel, cn } from 'ui'
@@ -104,7 +105,7 @@ const IPv4SidePanel = () => {
Dedicated IPv4 address
}>
diff --git a/apps/studio/components/interfaces/Settings/Addons/PITRSidePanel.tsx b/apps/studio/components/interfaces/Settings/Addons/PITRSidePanel.tsx
index cfd5deb17d..c172b266ac 100644
--- a/apps/studio/components/interfaces/Settings/Addons/PITRSidePanel.tsx
+++ b/apps/studio/components/interfaces/Settings/Addons/PITRSidePanel.tsx
@@ -16,7 +16,7 @@ import type { AddonVariantId } from 'data/subscriptions/types'
import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'
import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization'
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
-import { BASE_PATH } from 'lib/constants'
+import { BASE_PATH, DOCS_URL } from 'lib/constants'
import { formatCurrency } from 'lib/helpers'
import { useAddonsPagePanel } from 'state/addons-page'
import {
@@ -167,7 +167,7 @@ const PITRSidePanel = () => {
Point in Time Recovery
}>
diff --git a/apps/studio/components/interfaces/Settings/Database/BannedIPs.tsx b/apps/studio/components/interfaces/Settings/Database/BannedIPs.tsx
index 952288603b..a230c390e2 100644
--- a/apps/studio/components/interfaces/Settings/Database/BannedIPs.tsx
+++ b/apps/studio/components/interfaces/Settings/Database/BannedIPs.tsx
@@ -14,6 +14,7 @@ import { useBannedIPsQuery } from 'data/banned-ips/banned-ips-query'
import { useUserIPAddressQuery } from 'data/misc/user-ip-address-query'
import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
+import { DOCS_URL } from 'lib/constants'
import { Badge, Skeleton } from 'ui'
import ConfirmationModal from 'ui-patterns/Dialogs/ConfirmationModal'
@@ -78,7 +79,7 @@ const BannedIPs = () => {
title="Network Bans"
description="List of IP addresses that are temporarily blocked if their traffic pattern looks abusive"
/>
-
+
}>
-
+
Read more about disk management
diff --git a/apps/studio/components/interfaces/Settings/Database/NetworkRestrictions/AddRestrictionModal.tsx b/apps/studio/components/interfaces/Settings/Database/NetworkRestrictions/AddRestrictionModal.tsx
index a57804265d..4ec7c60267 100644
--- a/apps/studio/components/interfaces/Settings/Database/NetworkRestrictions/AddRestrictionModal.tsx
+++ b/apps/studio/components/interfaces/Settings/Database/NetworkRestrictions/AddRestrictionModal.tsx
@@ -5,6 +5,7 @@ import { Button, Form, Input, Modal, Tooltip, TooltipContent, TooltipTrigger } f
import InformationBox from 'components/ui/InformationBox'
import { useNetworkRestrictionsQuery } from 'data/network-restrictions/network-restrictions-query'
import { useNetworkRestrictionsApplyMutation } from 'data/network-restrictions/network-retrictions-apply-mutation'
+import { DOCS_URL } from 'lib/constants'
import { HelpCircle } from 'lucide-react'
import {
checkIfPrivate,
@@ -165,7 +166,7 @@ const AddRestrictionModal = ({
title="Note: Restrictions only apply to direct connections to your database and connection pooler"
description="They do not currently apply to APIs offered over HTTPS, such as PostgREST, Storage, or Authentication."
urlLabel="Learn more"
- url="https://supabase.com/docs/guides/platform/network-restrictions#limitations"
+ url={`${DOCS_URL}/guides/platform/network-restrictions#limitations`}
/>
diff --git a/apps/studio/components/interfaces/Settings/Database/NetworkRestrictions/NetworkRestrictions.tsx b/apps/studio/components/interfaces/Settings/Database/NetworkRestrictions/NetworkRestrictions.tsx
index 65455dd2ef..070aa1788e 100644
--- a/apps/studio/components/interfaces/Settings/Database/NetworkRestrictions/NetworkRestrictions.tsx
+++ b/apps/studio/components/interfaces/Settings/Database/NetworkRestrictions/NetworkRestrictions.tsx
@@ -12,6 +12,7 @@ import ShimmeringLoader from 'components/ui/ShimmeringLoader'
import { useNetworkRestrictionsQuery } from 'data/network-restrictions/network-restrictions-query'
import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
+import { DOCS_URL } from 'lib/constants'
import {
Badge,
Button,
@@ -109,7 +110,7 @@ const NetworkRestrictions = () => {
description="Allow specific IP ranges to have access to your database."
/>
diff --git a/apps/studio/components/interfaces/Storage/EditBucketModal.tsx b/apps/studio/components/interfaces/Storage/EditBucketModal.tsx
index 8f8cad5bed..47e7f318a0 100644
--- a/apps/studio/components/interfaces/Storage/EditBucketModal.tsx
+++ b/apps/studio/components/interfaces/Storage/EditBucketModal.tsx
@@ -14,7 +14,7 @@ import { InlineLink } from 'components/ui/InlineLink'
import { useProjectStorageConfigQuery } from 'data/config/project-storage-config-query'
import { useBucketUpdateMutation } from 'data/storage/bucket-update-mutation'
import { Bucket } from 'data/storage/buckets-query'
-import { IS_PLATFORM } from 'lib/constants'
+import { DOCS_URL, IS_PLATFORM } from 'lib/constants'
import {
Button,
Dialog,
@@ -267,7 +267,9 @@ export const EditBucketModal = ({ visible, bucket, onClose }: EditBucketModalPro
Assets cached in the CDN may still be publicly accessible. You can
consider{' '}
-
+
purging the cache
{' '}
or moving your assets to a new bucket.
diff --git a/apps/studio/components/interfaces/Storage/StoragePolicies/StoragePoliciesEditPolicyModal.tsx b/apps/studio/components/interfaces/Storage/StoragePolicies/StoragePoliciesEditPolicyModal.tsx
index 3259f2cd36..4b013668ce 100644
--- a/apps/studio/components/interfaces/Storage/StoragePolicies/StoragePoliciesEditPolicyModal.tsx
+++ b/apps/studio/components/interfaces/Storage/StoragePolicies/StoragePoliciesEditPolicyModal.tsx
@@ -6,6 +6,7 @@ import { POLICY_MODAL_VIEWS } from 'components/interfaces/Auth/Policies/Policies
import PolicySelection from 'components/interfaces/Auth/Policies/PolicySelection'
import PolicyTemplates from 'components/interfaces/Auth/Policies/PolicyTemplates'
import { DocsButton } from 'components/ui/DocsButton'
+import { DOCS_URL } from 'lib/constants'
import { ChevronLeft } from 'lucide-react'
import { Modal } from 'ui'
import {
@@ -184,7 +185,7 @@ const StoragePoliciesEditPolicyModal = ({
return (
{getTitle()}
-
+
)
}
diff --git a/apps/studio/components/interfaces/Storage/StoragePolicies/StoragePoliciesEditor.tsx b/apps/studio/components/interfaces/Storage/StoragePolicies/StoragePoliciesEditor.tsx
index b695460ab5..6b200e675f 100644
--- a/apps/studio/components/interfaces/Storage/StoragePolicies/StoragePoliciesEditor.tsx
+++ b/apps/studio/components/interfaces/Storage/StoragePolicies/StoragePoliciesEditor.tsx
@@ -3,6 +3,7 @@ import { Badge, Button, Checkbox, Modal } from 'ui'
import { PolicyName, PolicyRoles } from 'components/interfaces/Auth/Policies/PolicyEditor'
import SqlEditor from 'components/ui/SqlEditor'
+import { DOCS_URL } from 'lib/constants'
import { STORAGE_CLIENT_LIBRARY_MAPPINGS } from '../Storage.constants'
import { deriveAllowedClientLibraryMethods } from '../Storage.utils'
@@ -35,7 +36,7 @@ const PolicyAllowedOperations = ({ allowedOperations = [], onToggleOperation = (
),
})
@@ -121,7 +122,7 @@ export const useTableRowDeleteMutation = ({
each row before updating or deleting the row.
-
+
),
diff --git a/apps/studio/hooks/analytics/useLogsQuery.tsx b/apps/studio/hooks/analytics/useLogsQuery.tsx
index 4e4f8b84ae..33d9404c64 100644
--- a/apps/studio/hooks/analytics/useLogsQuery.tsx
+++ b/apps/studio/hooks/analytics/useLogsQuery.tsx
@@ -16,6 +16,7 @@ import {
checkForWithClause,
} from 'components/interfaces/Settings/Logs/Logs.utils'
import { get } from 'data/fetchers'
+import { DOCS_URL } from 'lib/constants'
export interface LogsQueryHook {
params: LogsEndpointParams
@@ -98,13 +99,13 @@ const useLogsQuery = (
if (usesWith) {
error = {
message: 'The parser does not yet support WITH and subquery statements.',
- docs: 'https://supabase.com/docs/guides/platform/advanced-log-filtering#the-with-keyword-and-subqueries-are-not-supported',
+ docs: `${DOCS_URL}/guides/platform/advanced-log-filtering#the-with-keyword-and-subqueries-are-not-supported`,
}
}
if (usesILIKE) {
error = {
message: 'BigQuery does not support ILIKE. Use REGEXP_CONTAINS instead.',
- docs: 'https://supabase.com/docs/guides/platform/advanced-log-filtering#the-ilike-and-similar-to-keywords-are-not-supported',
+ docs: `${DOCS_URL}/guides/platform/advanced-log-filtering#the-ilike-and-similar-to-keywords-are-not-supported`,
}
}
}
diff --git a/apps/studio/lib/ai/prompts.ts b/apps/studio/lib/ai/prompts.ts
index 09682ba2f0..43df8afb19 100644
--- a/apps/studio/lib/ai/prompts.ts
+++ b/apps/studio/lib/ai/prompts.ts
@@ -1,3 +1,5 @@
+import { DOCS_URL } from 'lib/constants'
+
export const RLS_PROMPT = `
Developer: # PostgreSQL RLS in Supabase: Condensed Guide
@@ -232,11 +234,11 @@ Developer: # Postgres Best Practices
- Enable Row Level Security (RLS) on all new tables with \`enable row level security\`; inform users that they need to add policies.
- Define foreign key references within the \`CREATE TABLE\` statement.
- Whenever a foreign key is used, generate a separate \`CREATE INDEX\` statement for the foreign key column(s) to improve performance on joins.
- - **Foreign Tables**: Place foreign tables in a schema named \`private\` (create the schema if needed). Explain the security risk (RLS bypass) and include a link: https://supabase.com/docs/guides/database/database-advisors?queryGroups=lint&lint=0017_foreign_table_in_api.
+ - **Foreign Tables**: Place foreign tables in a schema named \`private\` (create the schema if needed). Explain the security risk (RLS bypass) and include a link: ${DOCS_URL}/guides/database/database-advisors?queryGroups=lint&lint=0017_foreign_table_in_api.
- **Views**:
- Add \`with (security_invoker=on)\` immediately after \`CREATE VIEW view_name\`.
- - **Materialized Views**: Store materialized views in the \`private\` schema (create if needed). Explain the security risk (RLS bypass) and reference: https://supabase.com/docs/guides/database/database-advisors?queryGroups=lint&lint=0016_materialized_view_in_api.
+ - **Materialized Views**: Store materialized views in the \`private\` schema (create if needed). Explain the security risk (RLS bypass) and reference: ${DOCS_URL}/guides/database/database-advisors?queryGroups=lint&lint=0016_materialized_view_in_api.
- **Extensions**:
- Always install extensions in the \`extensions\` schema or a dedicated schema, never in \`public\`.
diff --git a/apps/studio/lib/constants/index.ts b/apps/studio/lib/constants/index.ts
index 79338ec013..4a95864039 100644
--- a/apps/studio/lib/constants/index.ts
+++ b/apps/studio/lib/constants/index.ts
@@ -45,6 +45,8 @@ export const POSTHOG_URL =
export const USAGE_APPROACHING_THRESHOLD = 0.75
+export const DOCS_URL = process.env.NEXT_PUBLIC_DOCS_URL || 'https://supabase.com/docs'
+
export const OPT_IN_TAGS = {
AI_SQL: 'AI_SQL_GENERATOR_OPT_IN',
AI_DATA: 'AI_DATA_GENERATOR_OPT_IN',
diff --git a/apps/studio/pages/account/tokens.tsx b/apps/studio/pages/account/tokens.tsx
index cae0704f8f..b03c749d4b 100644
--- a/apps/studio/pages/account/tokens.tsx
+++ b/apps/studio/pages/account/tokens.tsx
@@ -14,6 +14,7 @@ import {
ScaffoldSectionTitle,
} from 'components/layouts/Scaffold'
import { NewAccessToken } from 'data/access-tokens/access-tokens-create-mutation'
+import { DOCS_URL } from 'lib/constants'
import type { NextPageWithLayout } from 'types'
import { Button } from 'ui'
import { Input } from 'ui-patterns/DataInputs/Input'
@@ -45,20 +46,12 @@ const UserAccessTokens: NextPageWithLayout = () => {
/>
}>
-
+
API Docs
}>
-
+
CLI docs
diff --git a/apps/studio/pages/api/platform/projects/[ref]/run-lints.ts b/apps/studio/pages/api/platform/projects/[ref]/run-lints.ts
index e58f7b326f..4431f0c059 100644
--- a/apps/studio/pages/api/platform/projects/[ref]/run-lints.ts
+++ b/apps/studio/pages/api/platform/projects/[ref]/run-lints.ts
@@ -4,7 +4,7 @@ import { paths } from 'api-types'
import { fetchPost } from 'data/fetchers'
import { constructHeaders } from 'lib/api/apiHelpers'
import apiWrapper from 'lib/api/apiWrapper'
-import { PG_META_URL } from 'lib/constants'
+import { DOCS_URL, PG_META_URL } from 'lib/constants'
export default (req: NextApiRequest, res: NextApiResponse) => apiWrapper(req, res, handler)
@@ -92,7 +92,7 @@ select
fk.table_name,
fk.fkey_name
) as detail,
- 'https://supabase.com/docs/guides/database/database-linter?lint=0001_unindexed_foreign_keys' as remediation,
+ '${DOCS_URL}/guides/database/database-linter?lint=0001_unindexed_foreign_keys' as remediation,
jsonb_build_object(
'schema', fk.schema_name,
'name', fk.table_name,
@@ -132,7 +132,7 @@ select
'View/Materialized View "%s" in the public schema may expose \`auth.users\` data to anon or authenticated roles.',
c.relname
) as detail,
- 'https://supabase.com/docs/guides/database/database-linter?lint=0002_auth_users_exposed' as remediation,
+ '${DOCS_URL}/guides/database/database-linter?lint=0002_auth_users_exposed' as remediation,
jsonb_build_object(
'schema', n.nspname,
'name', c.relname,
@@ -246,12 +246,12 @@ select
array['PERFORMANCE'] as categories,
'Detects if calls to \`auth.()\` in RLS policies are being unnecessarily re-evaluated for each row' as description,
format(
- 'Table \`%s.%s\` has a row level security policy \`%s\` that re-evaluates an auth.() for each row. This produces suboptimal query performance at scale. Resolve the issue by replacing \`auth.()\` with \`(select auth.())\`. See [docs](https://supabase.com/docs/guides/database/postgres/row-level-security#call-functions-with-select) for more info.',
+ 'Table \`%s.%s\` has a row level security policy \`%s\` that re-evaluates an auth.() for each row. This produces suboptimal query performance at scale. Resolve the issue by replacing \`auth.()\` with \`(select auth.())\`. See [docs](${DOCS_URL}/guides/database/postgres/row-level-security#call-functions-with-select) for more info.',
schema_name,
table_name,
policy_name
) as detail,
- 'https://supabase.com/docs/guides/database/database-linter?lint=0003_auth_rls_initplan' as remediation,
+ '${DOCS_URL}/guides/database/database-linter?lint=0003_auth_rls_initplan' as remediation,
jsonb_build_object(
'schema', schema_name,
'name', table_name,
@@ -315,7 +315,7 @@ select
pgns.nspname,
pgc.relname
) as detail,
- 'https://supabase.com/docs/guides/database/database-linter?lint=0004_no_primary_key' as remediation,
+ '${DOCS_URL}/guides/database/database-linter?lint=0004_no_primary_key' as remediation,
jsonb_build_object(
'schema', pgns.nspname,
'name', pgc.relname,
@@ -362,7 +362,7 @@ select
psui.schemaname,
psui.relname
) as detail,
- 'https://supabase.com/docs/guides/database/database-linter?lint=0005_unused_index' as remediation,
+ '${DOCS_URL}/guides/database/database-linter?lint=0005_unused_index' as remediation,
jsonb_build_object(
'schema', psui.schemaname,
'name', psui.relname,
@@ -407,7 +407,7 @@ select
act.cmd,
array_agg(p.polname order by p.polname)
) as detail,
- 'https://supabase.com/docs/guides/database/database-linter?lint=0006_multiple_permissive_policies' as remediation,
+ '${DOCS_URL}/guides/database/database-linter?lint=0006_multiple_permissive_policies' as remediation,
jsonb_build_object(
'schema', n.nspname,
'name', c.relname,
@@ -478,7 +478,7 @@ select
c.relname,
array_agg(p.polname order by p.polname)
) as detail,
- 'https://supabase.com/docs/guides/database/database-linter?lint=0007_policy_exists_rls_disabled' as remediation,
+ '${DOCS_URL}/guides/database/database-linter?lint=0007_policy_exists_rls_disabled' as remediation,
jsonb_build_object(
'schema', n.nspname,
'name', c.relname,
@@ -523,7 +523,7 @@ select
n.nspname,
c.relname
) as detail,
- 'https://supabase.com/docs/guides/database/database-linter?lint=0008_rls_enabled_no_policy' as remediation,
+ '${DOCS_URL}/guides/database/database-linter?lint=0008_rls_enabled_no_policy' as remediation,
jsonb_build_object(
'schema', n.nspname,
'name', c.relname,
@@ -570,7 +570,7 @@ select
c.relname,
array_agg(pi.indexname order by pi.indexname)
) as detail,
- 'https://supabase.com/docs/guides/database/database-linter?lint=0009_duplicate_index' as remediation,
+ '${DOCS_URL}/guides/database/database-linter?lint=0009_duplicate_index' as remediation,
jsonb_build_object(
'schema', n.nspname,
'name', c.relname,
@@ -624,7 +624,7 @@ select
n.nspname,
c.relname
) as detail,
- 'https://supabase.com/docs/guides/database/database-linter?lint=0010_security_definer_view' as remediation,
+ '${DOCS_URL}/guides/database/database-linter?lint=0010_security_definer_view' as remediation,
jsonb_build_object(
'schema', n.nspname,
'name', c.relname,
@@ -677,7 +677,7 @@ select
n.nspname,
p.proname
) as detail,
- 'https://supabase.com/docs/guides/database/database-linter?lint=0011_function_search_path_mutable' as remediation,
+ '${DOCS_URL}/guides/database/database-linter?lint=0011_function_search_path_mutable' as remediation,
jsonb_build_object(
'schema', n.nspname,
'name', p.proname,
@@ -717,7 +717,7 @@ select
n.nspname,
c.relname
) as detail,
- 'https://supabase.com/docs/guides/database/database-linter?lint=0013_rls_disabled_in_public' as remediation,
+ '${DOCS_URL}/guides/database/database-linter?lint=0013_rls_disabled_in_public' as remediation,
jsonb_build_object(
'schema', n.nspname,
'name', c.relname,
@@ -757,7 +757,7 @@ select
'Extension \`%s\` is installed in the public schema. Move it to another schema.',
pe.extname
) as detail,
- 'https://supabase.com/docs/guides/database/database-linter?lint=0014_extension_in_public' as remediation,
+ '${DOCS_URL}/guides/database/database-linter?lint=0014_extension_in_public' as remediation,
jsonb_build_object(
'schema', pe.extnamespace::regnamespace,
'name', pe.extname,
@@ -811,7 +811,7 @@ select
table_name,
policy_name
) as detail,
- 'https://supabase.com/docs/guides/database/database-linter?lint=0015_rls_references_user_metadata' as remediation,
+ '${DOCS_URL}/guides/database/database-linter?lint=0015_rls_references_user_metadata' as remediation,
jsonb_build_object(
'schema', schema_name,
'name', table_name,
@@ -847,7 +847,7 @@ select
n.nspname,
c.relname
) as detail,
- 'https://supabase.com/docs/guides/database/database-linter?lint=0016_materialized_view_in_api' as remediation,
+ '${DOCS_URL}/guides/database/database-linter?lint=0016_materialized_view_in_api' as remediation,
jsonb_build_object(
'schema', n.nspname,
'name', c.relname,
@@ -890,7 +890,7 @@ select
n.nspname,
c.relname
) as detail,
- 'https://supabase.com/docs/guides/database/database-linter?lint=0017_foreign_table_in_api' as remediation,
+ '${DOCS_URL}/guides/database/database-linter?lint=0017_foreign_table_in_api' as remediation,
jsonb_build_object(
'schema', n.nspname,
'name', c.relname,
@@ -935,7 +935,7 @@ select
a.attname,
t.typname
) as detail,
- 'https://supabase.com/docs/guides/database/database-linter?lint=unsupported_reg_types' as remediation,
+ '${DOCS_URL}/guides/database/database-linter?lint=unsupported_reg_types' as remediation,
jsonb_build_object(
'schema', n.nspname,
'name', c.relname,
diff --git a/apps/studio/pages/new/[slug].tsx b/apps/studio/pages/new/[slug].tsx
index 2936e14012..cadcae32c7 100644
--- a/apps/studio/pages/new/[slug].tsx
+++ b/apps/studio/pages/new/[slug].tsx
@@ -58,6 +58,7 @@ import { getCloudProviderArchitecture } from 'lib/cloudprovider-utils'
import {
AWS_REGIONS_DEFAULT,
DEFAULT_MINIMUM_PASSWORD_STRENGTH,
+ DOCS_URL,
FLY_REGIONS_DEFAULT,
MANAGED_BY,
PROJECT_STATUS,
@@ -505,7 +506,7 @@ const Wizard: NextPageWithLayout = () => {
Each project includes a dedicated Postgres instance running on its own
server. You are charged for the{' '}
-
+
Compute resource
{' '}
of that server, independent of your database usage.
@@ -754,7 +755,7 @@ const Wizard: NextPageWithLayout = () => {