File tree 2 files changed +11
-4
lines changed
2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change 1
1
import AbstractDatabase from "../lib/AbstractDatabase" ;
2
- import { KeyValueDB } from "rusty-store-kv" ;
3
2
4
3
export default class Rusty_db extends AbstractDatabase {
5
- db : KeyValueDB | null | undefined
4
+ db : any | null | undefined
6
5
7
6
8
7
constructor ( settings : { filename : string } ) {
@@ -35,7 +34,16 @@ export default class Rusty_db extends AbstractDatabase {
35
34
}
36
35
37
36
async init ( ) {
38
- this . db = new KeyValueDB ( this . settings . filename ! ) ;
37
+ let RUSTY_DB
38
+ try {
39
+ RUSTY_DB = await import ( 'rusty-store-kv' ) ;
40
+ } catch ( err ) {
41
+ throw new Error (
42
+ 'better-sqlite3 not found. It was removed from ueberdb\'s dependencies because it requires ' +
43
+ 'compilation which fails on several systems. If you still want to use sqlite, run ' +
44
+ '"npm install better-sqlite3" in your etherpad-lite ./src directory.' ) ;
45
+ }
46
+ this . db = new RUSTY_DB . KeyValueDB ( this . settings . filename ! ) ;
39
47
}
40
48
41
49
close ( ) {
Original file line number Diff line number Diff line change 1
1
'use strict' ;
2
2
import { BulkObject } from "./cassandra_db" ;
3
3
import AbstractDatabase , { Settings } from "../lib/AbstractDatabase" ;
4
- import SQLITEDB from "better-sqlite3" ;
5
4
6
5
/**
7
6
* 2011 Peter 'Pita' Martischka
You can’t perform that action at this time.
0 commit comments