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(
|
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")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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() {
|
||||||
|
|
Loading…
Reference in New Issue