mirror of
https://github.com/fosrl/pangolin.git
synced 2026-04-01 15:36:38 +00:00
Define db type
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { Request, Response, NextFunction } from "express";
|
||||
import { sql } from "drizzle-orm";
|
||||
import { db } from "@server/db";
|
||||
import { db, DB_TYPE } from "@server/db";
|
||||
import logger from "@server/logger";
|
||||
import createHttpError from "http-errors";
|
||||
import HttpCode from "@server/types/HttpCode";
|
||||
@@ -96,12 +96,8 @@ async function dbQueryRows<T extends Record<string, unknown>>(
|
||||
return (await anyDb.all(query)) as T[];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true when the active database driver is SQLite (better-sqlite3).
|
||||
* Used to select the appropriate bulk-update strategy.
|
||||
*/
|
||||
function isSQLite(): boolean {
|
||||
return typeof (db as any).execute !== "function";
|
||||
return DB_TYPE == "sqlite";
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user