diff options
author | Samuel <34555296+Flam3rboy@users.noreply.github.com> | 2023-03-18 04:20:03 +0100 |
---|---|---|
committer | Samuel <34555296+Flam3rboy@users.noreply.github.com> | 2023-03-18 04:20:03 +0100 |
commit | fd1c99db2d0004cbdfa6e5a1e00f691614c249fd (patch) | |
tree | 5831b9f7d50e2ca31bed9ce1553a1b7bd217438f /src/util | |
parent | fix: remove proxy (diff) | |
download | server-fd1c99db2d0004cbdfa6e5a1e00f691614c249fd.tar.xz |
build: remove sqlite3 in favor of better-sqlite3
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/util/Database.ts | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/util/util/Database.ts b/src/util/util/Database.ts index 5d48ac03..1cf7adfd 100644 --- a/src/util/util/Database.ts +++ b/src/util/util/Database.ts @@ -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"; - -if (DatabaseType === "sqlite") { - try { - require("better-sqlite3"); - DatabaseType = "better-sqlite3"; - // eslint-disable-next-line no-empty - } catch (error) {} -} + : "better-sqlite"; + const isSqlite = DatabaseType.includes("sqlite"); const DataSourceOptions = new DataSource({ |