The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
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.tsxindex 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: booleanextension: 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 }: EnableExtensionMname="schema"value={defaultSchema}label="Select a schema to enable the extension for"- descriptionText={`Extension must be installed in ${defaultSchema}.`}+ descriptionText={getSchemaDescriptionText(extension.name, defaultSchema)}/>) : (<Listboxsize="small"name="schema"label="Select a schema to enable the extension for"+ descriptionText={getSchemaDescriptionText(extension.name, null)}><Listbox.Optionkey="custom"diff --git a/apps/studio/components/interfaces/Storage/VectorBuckets/CreateVectorTableSheet.tsx b/apps/studio/components/interfaces/Storage/VectorBuckets/CreateVectorTableSheet.tsxindex 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) => (