Type fixes.
This commit is contained in:
parent
e6cfe20432
commit
d681d5298b
|
@ -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 {
|
||||
|
|
|
@ -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() {
|
||||
|
|
Loading…
Reference in New Issue