From 93da29611d29494212fe62a288652205761cd943 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Tue, 19 Dec 2023 10:11:51 +0000 Subject: [PATCH] Fix type error. --- packages/backend-core/src/db/couch/DatabaseImpl.ts | 13 +------------ packages/server/src/integrations/couchdb.ts | 6 +++--- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/packages/backend-core/src/db/couch/DatabaseImpl.ts b/packages/backend-core/src/db/couch/DatabaseImpl.ts index 35b11fbd59..45aefc36f7 100644 --- a/packages/backend-core/src/db/couch/DatabaseImpl.ts +++ b/packages/backend-core/src/db/couch/DatabaseImpl.ts @@ -31,23 +31,12 @@ function buildNano(couchInfo: { url: string; cookie: string }) { }) } -export function DatabaseWithConnectionNoDD( - dbName: string, - connection: string, - opts?: DatabaseOpts -) { - if (!connection) { - throw new Error("Must provide connection details") - } - return new DatabaseImpl(dbName, opts, connection) -} - export function DatabaseWithConnection( dbName: string, connection: string, opts?: DatabaseOpts ) { - const db = DatabaseWithConnectionNoDD(dbName, connection, opts) + const db = new DatabaseImpl(dbName, opts, connection) return new DDInstrumentedDatabase(db, "couchdb") } diff --git a/packages/server/src/integrations/couchdb.ts b/packages/server/src/integrations/couchdb.ts index 4d78ace0ec..079f646b60 100644 --- a/packages/server/src/integrations/couchdb.ts +++ b/packages/server/src/integrations/couchdb.ts @@ -1,5 +1,6 @@ import { ConnectionInfo, + Database, DatasourceFeature, DatasourceFieldType, Document, @@ -8,7 +9,6 @@ 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 @@ -67,10 +67,10 @@ const SCHEMA: Integration = { } class CouchDBIntegration implements IntegrationBase { - private readonly client: dbCore.DatabaseImpl + private readonly client: Database constructor(config: CouchDBConfig) { - this.client = dbCore.DatabaseWithConnectionNoDD(config.database, config.url) + this.client = dbCore.DatabaseWithConnection(config.database, config.url) } async testConnection() {