mirror of
https://github.com/fosrl/pangolin.git
synced 2026-04-29 20:29:41 +00:00
Move primaryDb into driver
This commit is contained in:
parent
d8b662496b
commit
3e01bfef7d
4 changed files with 4 additions and 13 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { db, requestAuditLog, driver } from "@server/db";
|
||||
import { db, requestAuditLog, driver, primaryDb } from "@server/db";
|
||||
import { registry } from "@server/openApi";
|
||||
import { NextFunction } from "express";
|
||||
import { Request, Response } from "express";
|
||||
|
|
@ -12,11 +12,6 @@ import response from "@server/lib/response";
|
|||
import logger from "@server/logger";
|
||||
import { getSevenDaysAgo } from "@app/lib/getSevenDaysAgo";
|
||||
|
||||
let primaryDb = db;
|
||||
if (driver == "pg") {
|
||||
primaryDb = db.$primary as typeof db; // select the primary instance in a replicated setup
|
||||
}
|
||||
|
||||
const queryAccessAuditLogsQuery = z.object({
|
||||
// iso string just validate its a parseable date
|
||||
timeStart: z
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue