Fix type error.
This commit is contained in:
parent
b6a0f9bc41
commit
93da29611d
|
@ -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")
|
||||
}
|
||||
|
||||
|
|
|
@ -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() {
|
||||
|
|
Loading…
Reference in New Issue