From 2d7ef6cee47b60db71426b6c0bcc1b30fc1cc9fa Mon Sep 17 00:00:00 2001 From: andz-bb Date: Thu, 19 Dec 2024 16:24:55 +0000 Subject: [PATCH] allow users to select firestore databases other than the default --- packages/server/src/integrations/firebase.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/server/src/integrations/firebase.ts b/packages/server/src/integrations/firebase.ts index 3f03f295a9..f96817616d 100644 --- a/packages/server/src/integrations/firebase.ts +++ b/packages/server/src/integrations/firebase.ts @@ -12,6 +12,7 @@ interface FirebaseConfig { email: string privateKey: string projectId: string + databaseId?: string } const SCHEMA: Integration = { @@ -30,12 +31,21 @@ const SCHEMA: Integration = { }, privateKey: { type: DatasourceFieldType.STRING, + display: "Private Key", required: true, }, projectId: { type: DatasourceFieldType.STRING, + display: "Project ID", required: true, }, + databaseId: { + type: DatasourceFieldType.STRING, + display: "Database ID", + required: false, + default: "(default)", + placeholder: "(default)", + }, }, query: { create: { @@ -97,6 +107,7 @@ class FirebaseIntegration implements IntegrationBase { this.config = config this.client = new Firestore({ projectId: config.projectId, + databaseId: config.databaseId || "(default)", credentials: { client_email: config.email, private_key: config.privateKey?.replace(/\\n/g, "\n"),