Fix type error.

This commit is contained in:
Sam Rose 2023-12-19 10:11:51 +00:00
parent b6a0f9bc41
commit 93da29611d
No known key found for this signature in database
2 changed files with 4 additions and 15 deletions

View File

@ -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( export function DatabaseWithConnection(
dbName: string, dbName: string,
connection: string, connection: string,
opts?: DatabaseOpts opts?: DatabaseOpts
) { ) {
const db = DatabaseWithConnectionNoDD(dbName, connection, opts) const db = new DatabaseImpl(dbName, opts, connection)
return new DDInstrumentedDatabase(db, "couchdb") return new DDInstrumentedDatabase(db, "couchdb")
} }

View File

@ -1,5 +1,6 @@
import { import {
ConnectionInfo, ConnectionInfo,
Database,
DatasourceFeature, DatasourceFeature,
DatasourceFieldType, DatasourceFieldType,
Document, Document,
@ -8,7 +9,6 @@ import {
QueryType, QueryType,
} from "@budibase/types" } from "@budibase/types"
import { db as dbCore } from "@budibase/backend-core" import { db as dbCore } from "@budibase/backend-core"
import { DatabaseWithConnectionNoDD } from "@budibase/backend-core/src/db"
interface CouchDBConfig { interface CouchDBConfig {
url: string url: string
@ -67,10 +67,10 @@ const SCHEMA: Integration = {
} }
class CouchDBIntegration implements IntegrationBase { class CouchDBIntegration implements IntegrationBase {
private readonly client: dbCore.DatabaseImpl private readonly client: Database
constructor(config: CouchDBConfig) { constructor(config: CouchDBConfig) {
this.client = dbCore.DatabaseWithConnectionNoDD(config.database, config.url) this.client = dbCore.DatabaseWithConnection(config.database, config.url)
} }
async testConnection() { async testConnection() {