Files
supabase/apps/studio/components/interfaces/Integrations/Integration/IntegrationOverviewTabV2/IntegrationOverviewTabV2.utils.ts
Joshen Lim 4fdeed448b Joshen/fe 2854 migrate queues integration to new UI (#44270)
## Context

Related to marketplace related work, just moves the Queues integration
to the new UI (Changes are feature flagged)
<img width="1145" height="584" alt="image"
src="https://github.com/user-attachments/assets/d3245889-597d-44e2-9850-f20907e42056"
/>

Installation is now in a side panel with the intention that it'll just
be a single click to install integrations that involve multiple parts
<img width="400" height="955" alt="image"
src="https://github.com/user-attachments/assets/71903b61-6bd2-486c-903e-b48ae2133887"
/>


## To test
- Verify that you can install the integration and everything else should
be status quo
- Verify that everything should be status quo if the flag is off
2026-03-30 14:23:21 +08:00

43 lines
1.4 KiB
TypeScript

import { getEnableDatabaseExtensionSQL } from '@supabase/pg-meta'
import { DatabaseExtension } from '@/data/database-extensions/database-extensions-query'
export const getEnableExtensionsSQL = ({
extensions,
extensionsSchema,
}: {
extensions: DatabaseExtension[]
extensionsSchema: {
[key: string]: { schema: string; value: string | undefined }
}
}) => {
return extensions
.map((extension) => {
/**
* [Joshen] Hard-coding pg_cron here as this is enforced on our end (Not via pg_available_extension_versions)
* Also temp hardcoding to `extensions` for now, but we should be retrieving the default schema from `pg_available_extension_versions`
* Am checking with pg-meta team whether we can just return that data directly from the /pg-meta/extensions endpoint, rather
* than using dashboard's `useDatabaseExtensionDefaultSchemaQuery` - we can technically save a query if so
*/
const { name, default_version: version } = extension
const createSchema = extensionsSchema[name].schema === 'custom'
const schema =
name === 'pg_cron'
? 'pg_catalog'
: createSchema
? (extensionsSchema[name].value as string)
: extensionsSchema[name].schema
return getEnableDatabaseExtensionSQL({
schema,
name,
version,
cascade: true,
createSchema,
})
})
.filter(Boolean)
.join('\n\n')
.trim()
}