The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
feat: new database envs for Vercel integration (#8462)
Hieu Phamc8b53bb35bef
diff --git a/studio/components/to-be-cleaned/Integration/Vercel.utils.ts b/studio/components/to-be-cleaned/Integration/Vercel.utils.tsindex 7d67251b89d..62ea80a48bf 100644--- a/studio/components/to-be-cleaned/Integration/Vercel.utils.ts+++ b/studio/components/to-be-cleaned/Integration/Vercel.utils.ts@@ -126,6 +126,8 @@ export function prepareVercelEvns(type: 'encrypted' | string}[],project: {+ db_host?: string+ db_password?: stringendpoint: stringanon_key: stringservice_key: string@@ -141,14 +143,22 @@ export function prepareVercelEvns(target: ('production' | 'development' | 'preview')[]} = { key: x.key, type: x.type, target: ['production', 'development', 'preview'], value: '' }- if (x.alias == INTEGRATION_ENVS_ALIAS.ENDPOINT) {- env.value = project.endpoint- }- if (x.alias == INTEGRATION_ENVS_ALIAS.ANONKEY) {- env.value = project.anon_key- }- if (x.alias == INTEGRATION_ENVS_ALIAS.SERVICEKEY) {- env.value = project.service_key+ switch (x.alias) {+ case INTEGRATION_ENVS_ALIAS.ENDPOINT: {+ env.value = project.endpoint+ }+ case INTEGRATION_ENVS_ALIAS.ANONKEY: {+ env.value = project.anon_key+ }+ case INTEGRATION_ENVS_ALIAS.SERVICEKEY: {+ env.value = project.service_key+ }+ case INTEGRATION_ENVS_ALIAS.DBHOST: {+ env.value = project.db_host ?? ''+ }+ case INTEGRATION_ENVS_ALIAS.DBPASSWORD: {+ env.value = project.db_password ?? ''+ }}envs.push(env)diff --git a/studio/lib/vercelConfigs.ts b/studio/lib/vercelConfigs.tsindex 2e484ec513c..5217cfc99f4 100644--- a/studio/lib/vercelConfigs.ts+++ b/studio/lib/vercelConfigs.ts@@ -6,6 +6,8 @@ export const INTEGRATION_ENVS_ALIAS = {ENDPOINT: 'SUPABASE_ENDPOINT',ANONKEY: 'SUPABASE_ANON_KEY',SERVICEKEY: 'SUPABASE_SERVICE_KEY',+ DBHOST: 'SUPABASE_DB_HOST',+ DBPASSWORD: 'SUPABASE_DB_PASSWORD',}export const VERCEL_DEFAULT_EXTERNAL_ID = 'nextjs-initial-project'/*@@ -101,6 +103,16 @@ export const VERCEL_INTEGRATION_CONFIGS = [alias: INTEGRATION_ENVS_ALIAS.SERVICEKEY,type: 'encrypted',},+ {+ key: 'SUPABASE_DB_HOST',+ alias: INTEGRATION_ENVS_ALIAS.DBHOST,+ type: 'encrypted',+ },+ {+ key: 'SUPABASE_DB_PASSWORD',+ alias: INTEGRATION_ENVS_ALIAS.DBPASSWORD,+ type: 'encrypted',+ },],},{diff --git a/studio/pages/vercel/setupProject.tsx b/studio/pages/vercel/setupProject.tsxindex c16c5a1081a..dd32f82c54f 100644--- a/studio/pages/vercel/setupProject.tsx+++ b/studio/pages/vercel/setupProject.tsx@@ -214,7 +214,8 @@ const CreateProject = observer(() => {auth_site_url: _store.selectedVercelProjectUrl,vercel_configuration_id: _store.configurationId,}- return await post(`${API_URL}/projects`, data)+ const project = await post(`${API_URL}/projects`, data)+ return { ...project, db_host: `db.${project.ref}.supabase.co`, db_password: dbPass }}async function onCreateProject() {