You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
potato-launcher/src/js/database/databaseHandler.js

51 lines
893 B

import PouchDB from 'pouchdb'
import PouchDBfind from 'pouchdb-find'
/**
* PouchdbHandler, for create
*
* @author Björn Hase
* @license https://www.gnu.org/licenses/gpl-3.0.en.html GPL-3
* @link https://gitea.node001.net/HerrHase/potato-launcher.git
*
*/
class DatabaseHandler {
/**
*
*
*/
constructor() {
PouchDB.plugin(PouchDBfind)
this.db = new PouchDB('apps', {
revs_limit: 0
})
}
/**
* adding index for current class
*
* @param {array} fields
*
*/
createIndex(fields) {
// adding index
try {
this.db.createIndex({
index: {
fields: fields
}
}).then(() => {
})
} catch (error) {
console.log(error)
}
}
}
export default DatabaseHandler