2023-01-11 10:37:37 +01:00
|
|
|
import * as core from "@budibase/backend-core"
|
2022-11-14 23:55:47 +01:00
|
|
|
import env from "../environment"
|
|
|
|
|
2023-02-21 18:22:23 +01:00
|
|
|
export function init() {
|
|
|
|
const dbConfig: any = {
|
|
|
|
replication: true,
|
|
|
|
find: true,
|
|
|
|
}
|
|
|
|
|
2022-11-14 23:55:47 +01:00
|
|
|
if (env.isTest() && !env.COUCH_DB_URL) {
|
|
|
|
dbConfig.inMemory = true
|
2023-02-21 18:22:23 +01:00
|
|
|
dbConfig.allDbs = true
|
2022-11-14 23:55:47 +01:00
|
|
|
}
|
2023-02-21 18:22:23 +01:00
|
|
|
|
2022-11-14 23:55:47 +01:00
|
|
|
core.init({ db: dbConfig })
|
|
|
|
}
|