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() {