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,
|
dbName: string,
|
||||||
connection: string,
|
connection: string,
|
||||||
opts?: DatabaseOpts
|
opts?: DatabaseOpts
|
||||||
|
@ -39,10 +39,16 @@ export function DatabaseWithConnection(
|
||||||
if (!connection) {
|
if (!connection) {
|
||||||
throw new Error("Must provide connection details")
|
throw new Error("Must provide connection details")
|
||||||
}
|
}
|
||||||
return new DDInstrumentedDatabase(
|
return new DatabaseImpl(dbName, opts, connection)
|
||||||
new DatabaseImpl(dbName, opts, connection),
|
}
|
||||||
"couchdb"
|
|
||||||
)
|
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 {
|
export class DatabaseImpl implements Database {
|
||||||
|
|
|
@ -8,6 +8,7 @@ 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
|
||||||
|
@ -69,7 +70,7 @@ class CouchDBIntegration implements IntegrationBase {
|
||||||
private readonly client: dbCore.DatabaseImpl
|
private readonly client: dbCore.DatabaseImpl
|
||||||
|
|
||||||
constructor(config: CouchDBConfig) {
|
constructor(config: CouchDBConfig) {
|
||||||
this.client = dbCore.DatabaseWithConnection(config.database, config.url)
|
this.client = dbCore.DatabaseWithConnectionNoDD(config.database, config.url)
|
||||||
}
|
}
|
||||||
|
|
||||||
async testConnection() {
|
async testConnection() {
|
||||||
|
|
Loading…
Reference in New Issue