diff --git a/databases/rusty_db.ts b/databases/rusty_db.ts index 56a3dcf9..e7da4bba 100644 --- a/databases/rusty_db.ts +++ b/databases/rusty_db.ts @@ -1,4 +1,5 @@ import AbstractDatabase from "../lib/AbstractDatabase"; +import {KeyValueDB} from 'rusty-store-kv' export default class Rusty_db extends AbstractDatabase { db: any |null| undefined @@ -33,16 +34,8 @@ export default class Rusty_db extends AbstractDatabase { } async init() { - let RUSTY_DB - try { - RUSTY_DB = await import('rusty-store-kv'); - } catch (err) { - throw new Error( - 'rusty-store-kv not found. It was removed from ueberdb\'s dependencies because it requires ' + - 'compilation which fails on several systems. If you still want to use rusty store kv, run ' + - '"pnpm install rusty-store-kv" in your etherpad-lite ./src directory.'); - } - this.db = new RUSTY_DB.KeyValueDB(this.settings.filename!); + + this.db = new KeyValueDB(this.settings.filename!); } close() { diff --git a/databases/sqlite_db.ts b/databases/sqlite_db.ts index 5b25ab8e..f276b74a 100644 --- a/databases/sqlite_db.ts +++ b/databases/sqlite_db.ts @@ -1,6 +1,7 @@ 'use strict'; import {BulkObject} from "./cassandra_db"; import AbstractDatabase, {Settings} from "../lib/AbstractDatabase"; +import {SQLite} from "rusty-store-kv"; /** * 2011 Peter 'Pita' Martischka @@ -43,16 +44,7 @@ export default class SQLiteDB extends AbstractDatabase { } init(callback: Function) { - let SQLITEDB - try { - SQLITEDB = require('rusty-store-kv'); - } catch (err) { - throw new Error( - 'rusty-store-kv not found. It was removed from ueberdb\'s dependencies because it requires ' + - 'compilation which fails on several systems. If you still want to use sqlite, run ' + - '"pnpm install rusty-store-kv" in your etherpad-lite ./src directory.'); - } - this.db = new SQLITEDB.SQLite(this.settings.filename as string) + this.db = new SQLite(this.settings.filename as string) callback(); } diff --git a/package.json b/package.json index bad6a1d7..b48390b5 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,7 @@ "url": "https://github.com/ether/ueberDB.git" }, "main": "./dist/index.js", - "version": "4.2.104", + "version": "5.0.0", "bugs": { "url": "https://github.com/ether/ueberDB/issues" },