)
}
diff --git a/apps/studio/components/interfaces/Docs/Pages/Tables/Introduction.tsx b/apps/studio/components/interfaces/Docs/Pages/Tables/Introduction.tsx
index 499b9709810..d3116933cb6 100644
--- a/apps/studio/components/interfaces/Docs/Pages/Tables/Introduction.tsx
+++ b/apps/studio/components/interfaces/Docs/Pages/Tables/Introduction.tsx
@@ -3,13 +3,22 @@ import Link from 'next/link'
import CodeSnippet from 'components/interfaces/Docs/CodeSnippet'
import GeneratingTypes from 'components/interfaces/Docs/GeneratingTypes'
+import { useProjectPostgrestConfigQuery } from 'data/config/project-postgrest-config-query'
+import PublicSchemaNotEnabledAlert from '../../PublicSchemaNotEnabledAlert'
interface IntroductionProps {
selectedLang: 'bash' | 'js'
}
const Introduction = ({ selectedLang }: IntroductionProps) => {
- const { ref } = useParams()
+ const { ref: projectRef } = useParams()
+
+ const { data: config } = useProjectPostgrestConfigQuery({ projectRef })
+
+ const isPublicSchemaEnabled = config?.db_schema
+ .split(',')
+ .map((name) => name.trim())
+ .includes('public')
return (
<>
@@ -20,6 +29,8 @@ const Introduction = ({ selectedLang }: IntroductionProps) => {
All views and tables in the public schema and accessible by the active
database role for a request are available for querying.
+
+ {!isPublicSchemaEnabled && }
@@ -56,7 +67,7 @@ const Introduction = ({ selectedLang }: IntroductionProps) => {
If you still want to use GraphQL, you can. Supabase provides you with a full Postgres
database, so as long as your middleware can connect to the database then you can still
use the tools you love. You can find the database connection details{' '}
- in the settings.
+ in the settings.
diff --git a/apps/studio/components/interfaces/Docs/PublicSchemaNotEnabledAlert.tsx b/apps/studio/components/interfaces/Docs/PublicSchemaNotEnabledAlert.tsx
new file mode 100644
index 00000000000..99be76b020f
--- /dev/null
+++ b/apps/studio/components/interfaces/Docs/PublicSchemaNotEnabledAlert.tsx
@@ -0,0 +1,37 @@
+import { AlertDescription_Shadcn_, AlertTitle_Shadcn_, Alert_Shadcn_, Button } from 'ui'
+import { Info } from 'lucide-react'
+import ReactMarkdown from 'react-markdown'
+import Link from 'next/link'
+import { useParams } from 'common'
+
+const PublicSchemaNotEnabledAlert = () => {
+ const { ref: projectRef } = useParams()
+
+ return (
+
+
+
+ The `public` schema for this project is not exposed
+
+
+
+ You will not be able to query tables and views in the `public` schema via supabase-js or
+ HTTP clients.
+
+
+