0
Hello I’m starting to program now and I was following a video lesson and following the teacher’s steps, however arrived in a part that he installed the sqlite, however his version was previous to mine and changed something within the Database.js of sqlite, after a lot of head breaking I discovered, however I do not know how to proceed precisely because it is very early yet...
When I write const dbConnection = sqlite.open()
within the parentheses of . open appears the balloon written
open(config: Isqlite.Config): Promise<Database<Database, Statement>>
inside the Database.js file in the open() part is like this :
open() {
return new Promise((resolve, reject) => {
let { filename, mode, driver } = this.config;
if (!filename) {
throw new Error('sqlite: filename is not defined');
}
if (!driver) {
throw new Error('sqlite: driver is not defined');
}
if (mode) {
this.db = new driver(filename, mode, err => {
if (err) {
return reject(err);
}
resolve();
});
}
else {
this.db = new driver(filename, err => {
if (err) {
return reject(err);
}
resolve();
});
}
});
}
what I should write inside the parentheses?
in the video class the teacher wrote like this:
const dbConnection = sqlite.open('banco.sqlite', { Promise})
but I already know that this is not right