build: remove sqlite3 in favor of better-sqlite3
This commit is contained in:
parent
d97dbdf73c
commit
fd1c99db2d
BIN
package-lock.json
generated
BIN
package-lock.json
generated
Binary file not shown.
@ -116,7 +116,6 @@
|
||||
"erlpack": "^0.1.4",
|
||||
"nodemailer-mailgun-transport": "^2.1.5",
|
||||
"nodemailer-mailjet-transport": "github:n0script22/nodemailer-mailjet-transport",
|
||||
"nodemailer-sendgrid-transport": "github:Maria-Golomb/nodemailer-sendgrid-transport",
|
||||
"sqlite3": "^5.1.6"
|
||||
"nodemailer-sendgrid-transport": "github:Maria-Golomb/nodemailer-sendgrid-transport"
|
||||
}
|
||||
}
|
||||
|
||||
@ -36,17 +36,10 @@ if (!process.env) {
|
||||
const dbConnectionString =
|
||||
process.env.DATABASE || path.join(process.cwd(), "database.db");
|
||||
|
||||
let DatabaseType = dbConnectionString.includes("://")
|
||||
const DatabaseType = dbConnectionString.includes("://")
|
||||
? dbConnectionString.split(":")[0]?.replace("+srv", "")
|
||||
: "sqlite";
|
||||
: "better-sqlite";
|
||||
|
||||
if (DatabaseType === "sqlite") {
|
||||
try {
|
||||
require("better-sqlite3");
|
||||
DatabaseType = "better-sqlite3";
|
||||
// eslint-disable-next-line no-empty
|
||||
} catch (error) {}
|
||||
}
|
||||
const isSqlite = DatabaseType.includes("sqlite");
|
||||
|
||||
const DataSourceOptions = new DataSource({
|
||||
|
||||
Reference in New Issue
Block a user