Skip to content

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

feat(studio): recommended schemas for extensions (#40968)

Danny White203beab855f9
diff --git a/apps/studio/components/interfaces/Database/Extensions/EnableExtensionModal.tsx b/apps/studio/components/interfaces/Database/Extensions/EnableExtensionModal.tsx
index d8662ed7686..e5ec6962633 100644
--- a/apps/studio/components/interfaces/Database/Extensions/EnableExtensionModal.tsx
+++ b/apps/studio/components/interfaces/Database/Extensions/EnableExtensionModal.tsx
@@ -26,6 +26,11 @@ import { Admonition } from 'ui-patterns'
const orioleExtCallOuts = ['vector', 'postgis']
+// Extensions that have recommended schemas (rather than required schemas)
+const extensionsWithRecommendedSchemas: Record<string, string> = {
+ wrappers: 'extensions',
+}
+
interface EnableExtensionModalProps {
visible: boolean
extension: PostgresExtension
@@ -89,6 +94,20 @@ const EnableExtensionModal = ({ visible, extension, onCancel }: EnableExtensionM
}
}, [visible, extension.name])
+ const getSchemaDescriptionText = (extensionName: string, schema: string | null | undefined) => {
+ // Prioritize defaultSchema (required/forced) over recommended schema
+ if (schema) {
+ return `Extension must be installed in the “${schema}” schema.`
+ }
+
+ const recommendedSchema = extensionsWithRecommendedSchemas[extensionName]
+ if (recommendedSchema) {
+ return `Use the “${recommendedSchema}” schema for full compatibility with related features.`
+ }
+
+ return undefined
+ }
+
const validate = (values: any) => {
const errors: any = {}
if (values.schema === 'custom' && !values.name) errors.name = 'Required field'
@@ -165,13 +184,14 @@ const EnableExtensionModal = ({ visible, extension, onCancel }: EnableExtensionM
name="schema"
value={defaultSchema}
label="Select a schema to enable the extension for"
- descriptionText={`Extension must be installed in ${defaultSchema}.`}
+ descriptionText={getSchemaDescriptionText(extension.name, defaultSchema)}
/>
) : (
<Listbox
size="small"
name="schema"
label="Select a schema to enable the extension for"
+ descriptionText={getSchemaDescriptionText(extension.name, null)}
>
<Listbox.Option
key="custom"
diff --git a/apps/studio/components/interfaces/Storage/VectorBuckets/CreateVectorTableSheet.tsx b/apps/studio/components/interfaces/Storage/VectorBuckets/CreateVectorTableSheet.tsx
index eeba3b2f199..a1a5e83a3c9 100644
--- a/apps/studio/components/interfaces/Storage/VectorBuckets/CreateVectorTableSheet.tsx
+++ b/apps/studio/components/interfaces/Storage/VectorBuckets/CreateVectorTableSheet.tsx
@@ -327,7 +327,9 @@ export const CreateVectorTableSheet = ({ bucketName }: CreateVectorTableSheetPro
<SheetSection className="space-y-4">
<div className="flex items-center justify-between">
<label className="text-sm text-foreground">Metadata keys</label>
- <DocsButton href={`${DOCS_URL}/guides/storage/vector/introduction`} />
+ <DocsButton
+ href={`${DOCS_URL}/guides/storage/vector/storing-vectors#metadata-best-practices`}
+ />
</div>
<div className="space-y-2">
{fields.map((field, index) => (