1
0
Fork 0
mirror of synced 2024-07-13 18:26:06 +12:00
budibase/packages/datastores/index.js

29 lines
710 B
JavaScript
Raw Normal View History

import local from "./datastores/local"
import azureBlob from "./datastores/azure-blob"
import memory from "./datastores/memory"
import getConfig from "./config"
import tests from "./tests"
2019-06-08 01:18:10 +12:00
const initialise = async () => {
const type = process.argv[2]
const config = (await getConfig())[type]
2019-06-08 01:18:10 +12:00
switch (type) {
case "local":
return { datastore: local(config.root), config }
case "memory":
return { datastore: memory(config), config }
case "azure":
return { datastore: azureBlob(config), config }
default:
break
}
2019-06-08 01:18:10 +12:00
}
initialise()
.then(init => {
return tests(init.datastore, init.config)
})
2020-02-26 04:21:23 +13:00
.then(() => console.log("done"))
.catch(e => console.log(e))