From d681d5298bb3da65c41425676eb0556f0b7621d6 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Mon, 18 Dec 2023 18:33:04 +0000 Subject: [PATCH] Type fixes. --- .../backend-core/src/db/couch/DatabaseImpl.ts | 16 +++++++++++----- packages/server/src/integrations/couchdb.ts | 3 ++- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/packages/backend-core/src/db/couch/DatabaseImpl.ts b/packages/backend-core/src/db/couch/DatabaseImpl.ts index c7c4f98e98..35b11fbd59 100644 --- a/packages/backend-core/src/db/couch/DatabaseImpl.ts +++ b/packages/backend-core/src/db/couch/DatabaseImpl.ts @@ -31,7 +31,7 @@ function buildNano(couchInfo: { url: string; cookie: string }) { }) } -export function DatabaseWithConnection( +export function DatabaseWithConnectionNoDD( dbName: string, connection: string, opts?: DatabaseOpts @@ -39,10 +39,16 @@ export function DatabaseWithConnection( if (!connection) { throw new Error("Must provide connection details") } - return new DDInstrumentedDatabase( - new DatabaseImpl(dbName, opts, connection), - "couchdb" - ) + return new DatabaseImpl(dbName, opts, connection) +} + +export function DatabaseWithConnection( + dbName: string, + connection: string, + opts?: DatabaseOpts +) { + const db = DatabaseWithConnectionNoDD(dbName, connection, opts) + return new DDInstrumentedDatabase(db, "couchdb") } export class DatabaseImpl implements Database { diff --git a/packages/server/src/integrations/couchdb.ts b/packages/server/src/integrations/couchdb.ts index b55468fd93..4d78ace0ec 100644 --- a/packages/server/src/integrations/couchdb.ts +++ b/packages/server/src/integrations/couchdb.ts @@ -8,6 +8,7 @@ import { QueryType, } from "@budibase/types" import { db as dbCore } from "@budibase/backend-core" +import { DatabaseWithConnectionNoDD } from "@budibase/backend-core/src/db" interface CouchDBConfig { url: string @@ -69,7 +70,7 @@ class CouchDBIntegration implements IntegrationBase { private readonly client: dbCore.DatabaseImpl constructor(config: CouchDBConfig) { - this.client = dbCore.DatabaseWithConnection(config.database, config.url) + this.client = dbCore.DatabaseWithConnectionNoDD(config.database, config.url) } async testConnection() {